JDK-8154108 : The CDS compact symbol table range check should be improved
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2016-04-12
  • Updated: 2017-08-14
  • Resolved: 2017-08-14
Related Reports
Relates :  
Description
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'.
Comments
This no longer applies after the work of 8072061.
14-08-2017