RFR: 8341908: CodeHeapAnalytics: Output Imperfections and unwanted vm termination [v3]

Amit Kumar amitkumar at openjdk.org
Thu Mar 20 09:38:10 UTC 2025


On Tue, 11 Feb 2025 21:06:48 GMT, Lutz Schmidt <lucy at openjdk.org> wrote:

>> Output is properly aligned again now. Was messed up when method hotness was removed (part of method sweeper).
>> Assertions have been replaced by printing an error message and gracefully returning. Avoids vm crashes caused by diagnostic actions.
>> Some code restructuring, removal of redundancies.
>> 
>> Reviews are highly welcomed.
>
> Lutz Schmidt has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8341908: fix make error

One thing I found a bit salty, is how we are printing blobType information. 

Before: 

--------------------------------------------------------------------
Address range [0x000003ff883cf000,0x000003ff8844f000), 512k
--------------------------------------------------------------------
                                                    compiler method
Addr(module)              offset              size  type lvl  blobType            Name
0x000003ff883cf008 (+0x00000008)                              buffer blob         flush_icache_stub
0x000003ff883cf408 (+0x00000408)                              runtime stub        Shared Runtime wrong_method_blob
0x000003ff883cf808 (+0x00000808)                              buffer blob         StubRoutines (initialstubs)
0x000003ff883d4a08 (+0x00005a08)                              runtime stub        Shared Runtime throw_StackOverflowError_blob
0x000003ff883d4e08 (+0x00005e08)                              buffer blob         StubRoutines (continuationstubs)
0x000003ff883d5908 (+0x00006908)                              buffer blob         Interpreter
0x000003ff8843c408 (+0x0006d408)                              adapter blob        I2C/C2I adapters
0x000003ff8843c808 (+0x0006d808)                              adapter blob        I2C/C2I adapters
0x000003ff8843cc08 (+0x0006dc08)                              adapter blob        I2C/C2I adapters
0x000003ff8843d008 (+0x0006e008)                              adapter blob        I2C/C2I adapters
0x000003ff8843d408 (+0x0006e408)                              adapter blob        I2C/C2I adapters


With current patch: 

--------------------------------------------------------------------
Address range [0x000003ff7c3cf000,0x000003ff7c44f000), 512k
--------------------------------------------------------------------
                                                   blob  compiler  method
Addr(module)              offset              size type  type lvl  Name
0x000003ff7c3cf008 (+0x00000008) 0x00000078(   0K)   A             flush_icache_stub
0x000003ff7c3cf408 (+0x00000408) 0x00000280(   0K)   Z             Shared Runtime wrong_method_blob
0x000003ff7c3cf808 (+0x00000808) 0x00005118(  20K)   A             StubRoutines (initialstubs)
0x000003ff7c3d4a08 (+0x00005a08) 0x000001e8(   0K)   Z             Shared Runtime throw_StackOverflowError_blob
0x000003ff7c3d4e08 (+0x00005e08) 0x00000ac8(   2K)   A             StubRoutines (continuationstubs)
0x000003ff7c3d5908 (+0x00006908) 0x00066a88( 410K)   A             Interpreter
0x000003ff7c43c408 (+0x0006d408) 0x00000218(   0K)   E             I2C/C2I adapters
0x000003ff7c43cb08 (+0x0006db08) 0x000001d0(   0K)   E             I2C/C2I adapters
0x000003ff7c43d008 (+0x0006e008) 0x000001d8(   0K)   E             I2C/C2I adapters
0x000003ff7c43d408 (+0x0006e408) 0x000001d8(   0K)   E             I2C/C2I adapters
0x000003ff7c43d808 (+0x0006e808) 0x00000238(   0K)   E             I2C/C2I adapters
0x000003ff7c43dc08 (+0x0006ec08) 0x00000228(   0K)   E             I2C/C2I adapters
0x000003ff7c43e008 (+0x0006f008) 0x00000230(   0K)   E             I2C/C2I adapters


And then we will refer the `typeTable` to understand the Type information: 

+---------------------------------------------------+
|  Block types used in the following CodeHeap dump  |
+---------------------------------------------------+
    - noType
  C - nMethod (under construction), cannot be observed
  N - nMethod (active)
  I - nMethod (inactive)
  X - nMethod (deopt)
  Z - runtime stub
  U - ricochet stub
  R - deopt stub
  ? - uncommon trap stub
  D - exception stub
  T - safepoint stub
  E - adapter blob
  S - MH adapter blob
  A - buffer blob
  -----------------------------------------------------


This seemed a bit overdoing, but I am fine with it.

src/hotspot/share/code/codeHeapState.cpp line 594:

> 592:   //   This is necessary to prevent an unsigned short overflow while accumulating space information.
> 593:   //
> 594:   if (!(granularity > 0)) {

Suggestion:

  if (granularity < 0) {

-------------

PR Review: https://git.openjdk.org/jdk/pull/21452#pullrequestreview-2701705565
PR Review Comment: https://git.openjdk.org/jdk/pull/21452#discussion_r2005064696


More information about the hotspot-compiler-dev mailing list