JDK-8217250 : Optimize CodeHeap Analytics
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,12,13
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2019-01-16
  • Updated: 2019-01-28
  • Resolved: 2019-01-21
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 13
13 b05Fixed
Related Reports
Cloners :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
This is to optimize CodeHeap Analytics printing by reducing the number of bufferedStream buffer flushes to (typically) tty. A macro is introduced which allows to specify the desired remaining capacity in the buffer. The buffer is flushed only if the remaining capacity is less. 
Comments
Sorry for reacting so late. I was out of the office on Tuesday with no access to eMail. This issue is PCH-specific. I didn't see it because I build non-PCH to avoid all the "missing #include" problems. Background: The PCH-step produces an output file where all macros have already been replaced by their actual values. Therefore, subsequent #defines are not permissible. In this specific case, the #define USE_BUFFEREDSTREAM does no harm. There is no use of the macro outside of CodeHeapState.cpp I'll come up with a solution ASAP. Most probably, moving the #define after the #includes will help.
23-01-2019

This has broken the build on Windows: jib > t:/workspace/open/src/hotspot/share/code/codeHeapState.cpp(30): error C2220: warning treated as error - no 'object' file generated jib > t:/workspace/open/src/hotspot/share/code/codeHeapState.cpp(30): warning C4603: 'USE_BUFFEREDSTREAM': macro is not defined or definition is different after precompiled header use jib > t:/workspace/open/src/hotspot/share/code/codeHeapState.cpp(30): note: Add macro to precompiled header instead of defining here jib > t:/workspace/open/src/hotspot/share/code/codeHeapState.cpp(32): note: use of precompiled header
21-01-2019

Implementation is in two steps: 1) Rename pre-existing STRINGSTREAM* macros to BUFFEREDSTREAM*. This better reflects the use of a bufferedStream* buffer. 2) Replace BUFFEREDSTREAM_FLUSH() and BUFFEREDSTREAM_FLUSH_LOCKED() macros by BUFFEREDSTREAM_FLUSH_IF() macros at suitable places.
16-01-2019