RFR: 8351661: NMT: VMATree should support separate call-stacks for reserve and commit operations [v25]

Gerard Ziemski gziemski at openjdk.org
Wed May 14 15:08:08 UTC 2025


On Wed, 14 May 2025 08:14:47 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> src/hotspot/share/nmt/vmatree.cpp line 654:
>> 
>>> 652:   });
>>> 653:   out->cr();
>>> 654: }
>> 
>> I have a different `print_on` function, called `print_timeline_on` which can produce output, such as:
>> 
>> 
>>           1         2         3         4         5
>> 01234567890123456789012345678901234567890123456789
>> ..........AAAAAAAAAA..........CCCCddddEE..........
>> Legend:
>>  A - GC (reserved)
>>  . - free
>>  C - Test (reserved)
>>  d - Test (committed)
>>  E - Test (reserved)
>>  . - free
>> 
>> 
>> instead of:
>> 
>> `10 (GC) - reserved [0, --]-> 20 (Unknown) - released [2147483646, --]-> 30 (Test) - reserved [0, --]-> 34 (Test) - committed [0, 0]-> 38 (Test) - reserved [0, --]-> 40 (Unknown) - released [2147483646, --]->` 
>> 
>> for tree:
>> 
>> 
>>     VMATree tree;
>>     Tree::RegionData gc(si, mtGC);
>>     Tree::RegionData test(si, mtTest);
>>     tree.reserve_mapping(10, 10, gc);
>>     tree.reserve_mapping(30, 10, test);
>>     tree.commit_mapping(34, 4, test);
>> 
>> 
>> Which I personally find easier to parse.
>> 
>> If you like, we can:
>> 
>> 1. add this function to this fix, in case others find its output useful
>> 2. add the output generated by this function to the comments for each of the cases in test_vmatree.cpp
>
> There are a few questions/concerns to use this new output:
> - the range of regions in tree may be 100-1000, then we need 1000 columns in print
> - not all the regions are used within that range, e.g., only 10-20 and 900-1000 are used. 
> - when we use `print_on` for debugging a real tree, the ranges are 16 hexadecimal digits, it would be hard to show them efficiently
> 
> I can add this visualization format to the test cases without changing the `print_on`. Is that OK?

Sure, let's see it.

Also, we can always change the ranges of our specific test cases to be kept [0..100] to make the print outs happy, can't we?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24028#discussion_r2089169269


More information about the hotspot-runtime-dev mailing list