JDK-8024651 : Remove the incorrect usage of Metablock::overhead()
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs25
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-09-11
  • Updated: 2014-01-14
  • Resolved: 2013-09-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 Other
8Fixed hs25Fixed
Related Reports
Blocks :  
Blocks :  
Description
In the following code we add byte_size with the Metablock::overhead(), which returns words and not bytes.

size_t get_raw_word_size(size_t word_size) {
    // If only the dictionary is going to be used (i.e., no
    // indexed free list), then there is a minimum size requirement.
    // MinChunkSize is a placeholder for the real minimum size JJJ
    size_t byte_size = word_size * BytesPerWord;

    size_t byte_size_with_overhead = byte_size + Metablock::overhead();

    size_t raw_bytes_size = MAX2(byte_size_with_overhead,
                                 Metablock::min_block_byte_size());
    raw_bytes_size = ARENA_ALIGN(raw_bytes_size);
    size_t raw_word_size = raw_bytes_size / BytesPerWord;
    assert(raw_word_size * BytesPerWord == raw_bytes_size, "Size problem");

    return raw_word_size;
  }

The code has changed since it was first written, and currently we overwrite the entire Metablock without leaving a header. Because of this we don't have any overhead any more. 

Metablock::overhead() is zero in product builds and non-zero in debug builds.