JDK-8016903 : Thread::_handle_area initial size too big
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-06-18
  • Updated: 2014-06-26
  • Resolved: 2013-07-10
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 JDK 9 Other
8Fixed 9Fixed hs25Fixed
Related Reports
Relates :  
Description
{HandleArea* Thread::_handle_area} is used to store the Handles allocated during native code execution. The current allocation policy is:

initial allocation = 1 Kilo bytes (see the constant Chunk::init_size in allocation.hpp)
subsequent allocations = 32 Kilo Bytes (see the constant Chunk::size)

The 1KB allocation is too big. See attachments trace.patch, eclipse.handles.log, eclipse.handles.results and sum_trace_handle_allocation.tcl for complete statistics:

You can see 99.9% of the cases we use 33 handles or less, which means instead of using Chunk::init_size, we can safely use 256 bytes for the initial allocation with virtually no performance impact.

The original switch over point is 99.98%, which is only about 0.1% higher than the switch-over point for 256 bytes. 

$ java -XX:+TraceHandleAllocation -jar $ECLIPSE64 2>&1 | tee eclipse.handles.log
$ tclsh ~/jdk/proj/ioisvn/scripts/sum_trace_handle_allocation.tcl < eclipse.handles.log | tee eclipse.handles.results

 count    accum    perc
157934   157934  47.81% Handles    0, Chunks   0
100901   258835  78.36% Handles    1, Chunks   0
 59379   318214  96.34% Handles    2, Chunks   0
  3590   321804  97.43% Handles    3, Chunks   0
  1344   323148  97.83% Handles    4, Chunks   0
     2   323150  97.83% Handles    4, Chunks   1
  1320   324470  98.23% Handles    5, Chunks   0
     1   324471  98.23% Handles    5, Chunks   1
  1305   325776  98.63% Handles    6, Chunks   0
     2   325778  98.63% Handles    6, Chunks   1
   632   326410  98.82% Handles    7, Chunks   0
   628   327038  99.01% Handles    8, Chunks   0
...
   114   329959  99.90% Handles   33, Chunks   0
...
     1   330240  99.98% Handles  108, Chunks   0
     1   330241  99.98% Handles  109, Chunks   1


Comments
Closing this bug now, as the commit in hsx25 (JDK-8020086) will be automatically brought forward to 9. URL: http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/cf9d71d3e474 User: iklam Date: 2013-07-08 21:35:20 +0000
10-07-2013

Attached benchmark results of before/after (bench.hsdev-16.txt, bench.slc04rfz.txt). I built before/after using JPRT. Ran the 2013/07/02 version of refworkload on two different linux/x64 hosts. No significant difference is found by the "compare" script. slc04rfz /tmp/iklam/refworkload/sym2b_20130703_4$ cat before.props j2se.home=/tmp/iklam/refworkload/sym2b_20130703_4/vm_before component=j2se benchmarks=reference_server resultsdir=logs.before volano.debug=true scimark.options= specjvm98.timeout=60 specjbb2005.timeout=90 specjbb2000.timeout=90 volano25.timeout=60 jetstream.timeout=10 specjbb2005.mode=custom specjbb2005.results_mode=last_warehouse specjbb2005.warehouse_sequence=1 2 3 4 5 6 7 8 globalvmoptions=-d64 -server -Xms512m -Xmx512m -showversion iterations=10 slc04rfz /tmp/iklam/refworkload/sym2b_20130703_4$ cat after.props j2se.home=/tmp/iklam/refworkload/sym2b_20130703_4/vm_after component=j2se benchmarks=reference_server resultsdir=logs.after volano.debug=true scimark.options= specjvm98.timeout=60 specjbb2005.timeout=90 specjbb2000.timeout=90 volano25.timeout=60 jetstream.timeout=10 specjbb2005.mode=custom specjbb2005.results_mode=last_warehouse specjbb2005.warehouse_sequence=1 2 3 4 5 6 7 8 globalvmoptions=-d64 -server -Xms512m -Xmx512m -showversion iterations=10
04-07-2013

HandleArea usage statistics.
18-06-2013