Examples of ObjectHeap


Examples of sun.jvm.hotspot.oops.ObjectHeap

    public void printOld() {
        PrintStream out = System.out;
        PrintStream err = System.err;
        // Ready to go with the database...
        ObjectHeap heap = VM.getVM().getObjectHeap();
        TBObjectHistogram histogram = new TBObjectHistogram();
        err.println("Iterating over heap. This may take a while...");
        long startTime = System.currentTimeMillis();
        heap.iterate(histogram);
        long endTime = System.currentTimeMillis();
        histogram.printOnOld(out);
        float secs = (float) (endTime - startTime) / 1000.0f;
        err.println("Heap traversal took " + secs + " seconds.");
    }
View Full Code Here

Examples of sun.jvm.hotspot.oops.ObjectHeap

    public void printPerm() {
        PrintStream out = System.out;
        PrintStream err = System.err;
        // Ready to go with the database...
        ObjectHeap heap = VM.getVM().getObjectHeap();
        TBObjectHistogram histogram = new TBObjectHistogram();
        err.println("Iterating over heap. This may take a while...");
        long startTime = System.currentTimeMillis();
        heap.iterate(histogram);
        long endTime = System.currentTimeMillis();
        histogram.printOnPerm(out);
        float secs = (float) (endTime - startTime) / 1000.0f;
        err.println("Heap traversal took " + secs + " seconds.");
    }
View Full Code Here

Examples of sun.jvm.hotspot.oops.ObjectHeap

                System.out.println("Currently allocated direct buffers:");
            }

            if (exactMallocMode || verbose) {
                final long pageSize = getStaticIntFieldValue("java.nio.Bits", "pageSize");
                ObjectHeap heap = VM.getVM().getObjectHeap();
                InstanceKlass deallocatorKlass = SystemDictionaryHelper
                        .findInstanceKlass("java.nio.DirectByteBuffer$Deallocator");
                final LongField addressField = (LongField) deallocatorKlass.findField("address", "J");
                final IntField capacityField = (IntField) deallocatorKlass.findField("capacity", "I");
                final int[] countHolder = new int[1];

                heap.iterateObjectsOfKlass(new DefaultHeapVisitor() {
                    public boolean doObj(Oop oop) {
                        long address = addressField.getValue(oop);
                        if (address == 0)
                            return false; // this deallocator has already been
                        // run
View Full Code Here

Examples of sun.jvm.hotspot.oops.ObjectHeap

            // 'this' at index 0.
            if (values.get(0).getType() == BasicType.getTConflict()) {
              return null;
            }
            OopHandle handle = values.oopHandleAt(0);
            ObjectHeap heap = vm.saObjectHeap();
            thisObject = vm.objectMirror(heap.newOop(handle));
        }
        return thisObject;
    }
View Full Code Here

Examples of sun.jvm.hotspot.oops.ObjectHeap

    private ValueImpl getSlotValue(StackValueCollection values,
                       BasicType variableType, int ss) {
        ValueImpl valueImpl = null;
        OopHandle handle = null;
        ObjectHeap heap = vm.saObjectHeap();
        if (values.get(ss).getType() == BasicType.getTConflict()) {
          // Dead locals, so just represent them as a zero of the appropriate type
          if (variableType == BasicType.T_BOOLEAN) {
            valueImpl = (BooleanValueImpl) vm.mirrorOf(false);
          } else if (variableType == BasicType.T_CHAR) {
            valueImpl = (CharValueImpl) vm.mirrorOf((char)0);
          } else if (variableType == BasicType.T_FLOAT) {
            valueImpl = (FloatValueImpl) vm.mirrorOf((float)0);
          } else if (variableType == BasicType.T_DOUBLE) {
            valueImpl = (DoubleValueImpl) vm.mirrorOf((double)0);
          } else if (variableType == BasicType.T_BYTE) {
            valueImpl = (ByteValueImpl) vm.mirrorOf((byte)0);
          } else if (variableType == BasicType.T_SHORT) {
            valueImpl = (ShortValueImpl) vm.mirrorOf((short)0);
          } else if (variableType == BasicType.T_INT) {
            valueImpl = (IntegerValueImpl) vm.mirrorOf((int)0);
          } else if (variableType == BasicType.T_LONG) {
            valueImpl = (LongValueImpl) vm.mirrorOf((long)0);
          } else if (variableType == BasicType.T_OBJECT) {
            // we may have an [Ljava/lang/Object; - i.e., Object[] with the
            // elements themselves may be arrays because every array is an Object.
            handle = null;
            valueImpl = (ObjectReferenceImpl) vm.objectMirror(heap.newOop(handle));
          } else if (variableType == BasicType.T_ARRAY) {
            handle = null;
            valueImpl = vm.arrayMirror((Array)heap.newOop(handle));
          } else if (variableType == BasicType.T_VOID) {
            valueImpl = new VoidValueImpl(vm);
          } else {
            throw new RuntimeException("Should not read here");
          }
        } else {
          if (variableType == BasicType.T_BOOLEAN) {
            valueImpl = (BooleanValueImpl) vm.mirrorOf(values.booleanAt(ss));
          } else if (variableType == BasicType.T_CHAR) {
            valueImpl = (CharValueImpl) vm.mirrorOf(values.charAt(ss));
          } else if (variableType == BasicType.T_FLOAT) {
            valueImpl = (FloatValueImpl) vm.mirrorOf(values.floatAt(ss));
          } else if (variableType == BasicType.T_DOUBLE) {
            valueImpl = (DoubleValueImpl) vm.mirrorOf(values.doubleAt(ss));
          } else if (variableType == BasicType.T_BYTE) {
            valueImpl = (ByteValueImpl) vm.mirrorOf(values.byteAt(ss));
          } else if (variableType == BasicType.T_SHORT) {
            valueImpl = (ShortValueImpl) vm.mirrorOf(values.shortAt(ss));
          } else if (variableType == BasicType.T_INT) {
            valueImpl = (IntegerValueImpl) vm.mirrorOf(values.intAt(ss));
          } else if (variableType == BasicType.T_LONG) {
            valueImpl = (LongValueImpl) vm.mirrorOf(values.longAt(ss));
          } else if (variableType == BasicType.T_OBJECT) {
            // we may have an [Ljava/lang/Object; - i.e., Object[] with the
            // elements themselves may be arrays because every array is an Object.
            handle = values.oopHandleAt(ss);
            valueImpl = (ObjectReferenceImpl) vm.objectMirror(heap.newOop(handle));
          } else if (variableType == BasicType.T_ARRAY) {
            handle = values.oopHandleAt(ss);
            valueImpl = vm.arrayMirror((Array)heap.newOop(handle));
          } else if (variableType == BasicType.T_VOID) {
            valueImpl = new VoidValueImpl(vm);
          } else {
            throw new RuntimeException("Should not read here");
          }
View Full Code Here

Examples of sun.jvm.hotspot.oops.ObjectHeap

            frame = (JavaVFrame) frame.javaSender();
            depth++;
        }

        // now convert List<OopHandle> to List<ObjectReference>
        ObjectHeap heap = vm.saObjectHeap();
        Iterator stk = stackDepth.iterator();
        for (Iterator loItr = lockedObjects.iterator(); loItr.hasNext(); ) {
            Oop obj = heap.newOop((OopHandle)loItr.next());
            ownedMonitorsInfo.add(new MonitorInfoImpl(vm, vm.objectMirror(obj), this,
                                                              ((Integer)stk.next()).intValue()));
        }
    }
View Full Code Here

Examples of sun.jvm.hotspot.oops.ObjectHeap

            if (Assert.ASSERTS_ENABLED) {
                Assert.that(values.size() > 0, "this is missing");
            }
            // 'this' at index 0.
            OopHandle handle = values.oopHandleAt(0);
            ObjectHeap heap = vm.saObjectHeap();
            thisObject = vm.objectMirror(heap.newOop(handle));
        }
        return thisObject;
    }
View Full Code Here

Examples of sun.jvm.hotspot.oops.ObjectHeap

    private ValueImpl getSlotValue(StackValueCollection values,
                       BasicType variableType, int ss) {
        ValueImpl valueImpl = null;
        OopHandle handle = null;
        ObjectHeap heap = vm.saObjectHeap();
        if (variableType == BasicType.T_BOOLEAN) {
            valueImpl = (BooleanValueImpl) vm.mirrorOf(values.booleanAt(ss));
        } else if (variableType == BasicType.T_CHAR) {
            valueImpl = (CharValueImpl) vm.mirrorOf(values.charAt(ss));
        } else if (variableType == BasicType.T_FLOAT) {
            valueImpl = (FloatValueImpl) vm.mirrorOf(values.floatAt(ss));
        } else if (variableType == BasicType.T_DOUBLE) {
            valueImpl = (DoubleValueImpl) vm.mirrorOf(values.doubleAt(ss));
        } else if (variableType == BasicType.T_BYTE) {
            valueImpl = (ByteValueImpl) vm.mirrorOf(values.byteAt(ss));
        } else if (variableType == BasicType.T_SHORT) {
            valueImpl = (ShortValueImpl) vm.mirrorOf(values.shortAt(ss));
        } else if (variableType == BasicType.T_INT) {
            valueImpl = (IntegerValueImpl) vm.mirrorOf(values.intAt(ss));
        } else if (variableType == BasicType.T_LONG) {
            valueImpl = (LongValueImpl) vm.mirrorOf(values.longAt(ss));
        } else if (variableType == BasicType.T_OBJECT) {
            // we may have an [Ljava/lang/Object; - i.e., Object[] with the
            // elements themselves may be arrays because every array is an Object.
            handle = values.oopHandleAt(ss);
            valueImpl = (ObjectReferenceImpl) vm.objectMirror(heap.newOop(handle));
        } else if (variableType == BasicType.T_ARRAY) {
            handle = values.oopHandleAt(ss);
            valueImpl = vm.arrayMirror((Array)heap.newOop(handle));
        } else if (variableType == BasicType.T_VOID) {
            valueImpl = new VoidValueImpl(vm);
        } else {
            throw new RuntimeException("Should not read here");
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.