RFR: 8301403: Eliminate memory allocations in JVMFlag::printFlags during signal handling [v11]

Johan Sjölen jsjolen at openjdk.org
Tue Jul 30 09:43:36 UTC 2024


On Fri, 26 Jul 2024 14:50:47 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

>> Allocating memory while handling an error should be avoided, however `JVMFlag::printFlags()` is used by crash log and it allocates memory to print flags sorted (using qsort).
>> 
>> We avoid memory allocation by using BitMapView (using stack storage for array of indices) for markers in a simple O(n^2) algorithm that lets us print in alphabetical order. Performance was measured and it's not an issue.
>> 
>> Running MACH5 tests...
>
> Gerard Ziemski has updated the pull request incrementally with one additional commit since the last revision:
> 
>   need 32 bit version of LogBytesPerWord too

LGTM, thanks for this.

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

Marked as reviewed by jsjolen (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/20202#pullrequestreview-2207199829


More information about the hotspot-runtime-dev mailing list