Search in sources :

Example 1 with DefaultHeapVisitor

use of sun.jvm.hotspot.oops.DefaultHeapVisitor in project spf4j by zolyfarkas.

the class VMHistograms method getHeapInstanceCountsHistogram.

public static TObjectIntMap<Klass> getHeapInstanceCountsHistogram() {
    final TObjectIntMap<Klass> counts = new TObjectIntHashMap(10240);
    VM vm = sun.jvm.hotspot.runtime.VM.getVM();
    vm.getObjectHeap().iterate(new DefaultHeapVisitor() {

        @Override
        public boolean doObj(final Oop oop) {
            counts.increment(oop.getKlass());
            oop.getKlass();
            return false;
        }
    });
    return counts;
}
Also used : DefaultHeapVisitor(sun.jvm.hotspot.oops.DefaultHeapVisitor) Oop(sun.jvm.hotspot.oops.Oop) Klass(sun.jvm.hotspot.oops.Klass) TObjectIntHashMap(gnu.trove.map.hash.TObjectIntHashMap) VM(sun.jvm.hotspot.runtime.VM)

Aggregations

TObjectIntHashMap (gnu.trove.map.hash.TObjectIntHashMap)1 DefaultHeapVisitor (sun.jvm.hotspot.oops.DefaultHeapVisitor)1 Klass (sun.jvm.hotspot.oops.Klass)1 Oop (sun.jvm.hotspot.oops.Oop)1 VM (sun.jvm.hotspot.runtime.VM)1