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

The CDS compact symbol table range check should be improved

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • 11
    • 9
    • hotspot
    • generic
    • generic

      The following range check limits the total shared space to be less than MAX_SHARED_DELTA unnecessarily. The shared symbols are allocated from the RO space at dump time. The max_delta can be calculated from the 'base_address - end_of_RO_space'.

      juint* CompactHashtableWriter::dump_buckets() {
        uintx base_address = 0;
        uintx max_delta = 0;
        int num_compact_buckets = 0;
        if (_type == CompactHashtable<Symbol*, char>::_symbol_table) {
          base_address = uintx(MetaspaceShared::shared_rs()->base());
          max_delta = uintx(MetaspaceShared::shared_rs()->size());
          assert(max_delta <= MAX_SHARED_DELTA, "range check");

      Also, it might even be better to just use the start address of RO space as the 'base_address'.

            jiangli Jiangli Zhou
            jiangli Jiangli Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: