Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8008041 | 8 | Ioi Lam | P4 | Closed | Fixed | b77 |
JDK-8007432 | hs25 | Ioi Lam | P4 | Closed | Fixed | b18 |
I wrote a script to find the "holes" in the class metadata structures caused by 8-byte alignment of pointer fields on 64-bit VMs. See attached run_pahole.sh script. It uses the Linux "pahole" to find the holes.
Results are in the attached file paholes.txt. Highlights are here. Fixing Method and MethodData should yield the most gain (about 1.5% saving of all class meta data for MedRec).
===== Klass ==== (save 8 bytes)
/* XXX 4 bytes hole, try to pack */
/* typedef jlong */ long int _last_biased_lock_bulk_revocation_time; /* 168 8 */
/* typedef markOop */ class markOopDesc * _prototype_header; /* 176 8 */
/* typedef jint */ int _biased_lock_revocation_count; /* 184 4 */
/* XXX 4 bytes hole, try to pack */
==== InstanceKlass === (save 8 bytes)
/* XXX 4 bytes hole, try to pack */
class JvmtiCachedClassFieldMap * _jvmti_cached_class_field_map; /* 416 8 */
bool _has_default_methods; /* 424 1 */
/* XXX 1 byte hole, try to pack */
volatile u2 _idnum_allocated_count; /* 426 2 */
/* XXX 4 bytes hole, try to pack */
=== Method === (save 8 bytes)
/* XXX 4 bytes hole, try to pack */
/* typedef jlong */ long int _prev_time; /* 56 8 */
/* --- cacheline 1 boundary (64 bytes) --- */
float _rate; /* 64 4 */
/* XXX 4 bytes hole, try to pack */
=== MethodData === (save 4 bytes)
/* typedef uint */ unsigned int _nof_overflow_traps; /* 32 4 */
/* XXX 4 bytes hole, try to pack */
Results are in the attached file paholes.txt. Highlights are here. Fixing Method and MethodData should yield the most gain (about 1.5% saving of all class meta data for MedRec).
===== Klass ==== (save 8 bytes)
/* XXX 4 bytes hole, try to pack */
/* typedef jlong */ long int _last_biased_lock_bulk_revocation_time; /* 168 8 */
/* typedef markOop */ class markOopDesc * _prototype_header; /* 176 8 */
/* typedef jint */ int _biased_lock_revocation_count; /* 184 4 */
/* XXX 4 bytes hole, try to pack */
==== InstanceKlass === (save 8 bytes)
/* XXX 4 bytes hole, try to pack */
class JvmtiCachedClassFieldMap * _jvmti_cached_class_field_map; /* 416 8 */
bool _has_default_methods; /* 424 1 */
/* XXX 1 byte hole, try to pack */
volatile u2 _idnum_allocated_count; /* 426 2 */
/* XXX 4 bytes hole, try to pack */
=== Method === (save 8 bytes)
/* XXX 4 bytes hole, try to pack */
/* typedef jlong */ long int _prev_time; /* 56 8 */
/* --- cacheline 1 boundary (64 bytes) --- */
float _rate; /* 64 4 */
/* XXX 4 bytes hole, try to pack */
=== MethodData === (save 4 bytes)
/* typedef uint */ unsigned int _nof_overflow_traps; /* 32 4 */
/* XXX 4 bytes hole, try to pack */
- backported by
-
JDK-8007432 Need to reorder metadata structures to reduce size (64-bit)
-
- Closed
-
-
JDK-8008041 Need to reorder metadata structures to reduce size (64-bit)
-
- Closed
-
- relates to
-
JDK-8005895 Inefficient InstanceKlass field packing wasts memory
-
- Closed
-