Possible Duplicate:
find which type of garbage collector is running
Is there a way to tell what garbage collector is being used in a jvm by default?
This will print out a list of all of the Garbage Collectors currently loaded in your JVM.
import java.lang.management.*;
import java.util.List;
public class x {
public static void main(String args[]) {
List<GarbageCollectorMXBean> l = ManagementFactory.getGarbageCollectorMXBeans();
for(GarbageCollectorMXBean b : l) {
System.out.println(b.getName());
}
}
}
Is JConsole what you're after?
Excerpt:
Garbage collector information: Information on GC, including the garbage collector names, number of collections performed, and total time spent performing GC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With