agent/src/share/classes/sun/jvm/hotspot/oops/Array.java

Print this page
rev 146 : [mq]: mixa.layout.patch

*** 97,107 **** public long getObjectSize() { ArrayKlass klass = (ArrayKlass) getKlass(); // We have to fetch the length of the array, shift (multiply) it // appropriately, up to wordSize, add the header, and align to // object size. ! long s = getLength() << klass.getLog2ElementSize(); s += klass.getArrayHeaderInBytes(); s = Oop.alignObjectSize(s); return s; } --- 97,107 ---- public long getObjectSize() { ArrayKlass klass = (ArrayKlass) getKlass(); // We have to fetch the length of the array, shift (multiply) it // appropriately, up to wordSize, add the header, and align to // object size. ! long s = getLength() * klass.getElementSize(); s += klass.getArrayHeaderInBytes(); s = Oop.alignObjectSize(s); return s; }