JDK-8217465 : [REDO] - Optimize CodeHeap Analytics
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,12,13
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2019-01-21
  • Updated: 2021-04-23
  • Resolved: 2019-01-30
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 11 JDK 13
11.0.12Fixed 13 b06Fixed
Related Reports
Cloners :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8217466 :  
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
Fix request (11u): This is a prerequisite/predecessor for the downport of JDK-8219586. For review and testing see the discussion there.
22-04-2021

tier1,hs-tier2 testing (including build on all Oracle's supported platforms) passed for wbrev.00.
30-01-2019

http://cr.openjdk.java.net/~lucy/webrevs/8217465.00/
29-01-2019

Revised fix ready. Submit repo not working (for me). Still trying...
24-01-2019

Lutz, just wondering, did you run this through the submit repo?
22-01-2019

The original patch also has: +// To activate, #define USE_BUFFERED_STREAM before including this header. but the comment is in a .cpp file not a header file.
21-01-2019

The original fix breaks the windows build because of this: + // With this declaration macro, it is possible to switch between + // - direct output into an argument-passed outputStream and + // - buffered output into a bufferedStream with subsequent flush + // of the filled buffer to the outputStream. + #define USE_BUFFEREDSTREAM + #include "precompiled.hpp" You can not have anything before the include of precompiled.hpp 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 Further, this will not work as might be expected if the intent is for the precompiled headers to see USE_BUFFEREDSTREAM defined, as that value would need to be defined at the time that the precompiled headers are _built_. If the define is only needed in the current file then it can be moved. If the define is needed by other headers then they cannot be precompiled, unless the define is set when the precompilation occurs.
21-01-2019