Since JDK 7 you can use the JDK command tool ‘jcmd’ such as:
jcmd <pid> GC.run
More Related Contents:
- How ‘random’ is allocation of memory when I say “new Integer” in Java?
- Can java finalize an object when it is still in scope?
- Is there a destructor for Java?
- Are static fields open for garbage collection?
- Garbage collection of String literals
- How to activate JMX on my JVM for access with jconsole?
- Java garbage collector – When does it collect?
- Garbage collection on a local variable
- Android – Activity Constructor vs onCreate
- Which loop has better performance? Why?
- When and how are classes garbage collected in Java?
- Size of Huge Objects directly allocated to Old Generation
- Java still uses system memory after deallocation of objects and garbage collection
- Connecting remote tomcat JMX instance using jConsole
- Thread Caching and Java Memory model
- How do I access memory usage programmatically via JMX?
- Will .hashcode() return a different int due to compaction of tenure space?
- Java GC safepoint
- Calling System.gc( ) explicitly?
- Does the garbage collector work on static variables or methods in java?
- How does Java Garbage collector handle self-reference?
- In Java is Permanent Generation space garbage collected?
- How do you enable JMX in Websphere?
- JConsole over ssh local port forwarding
- Is the garbage collector guaranteed to run before Out of Memory Error?
- How to make a long time Full GC in Java manually
- Java GC (Allocation Failure)
- Default garbage collector for Java 8
- Measuring time spent on GC
- When does Java’s garbage collection free a memory allocation?