Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8006280

Need to reorder metadata structures to reduce size (64-bit)

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        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 */


          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  iklam Ioi Lam
                  Reporter:
                  iklam Ioi Lam
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: