Integrated: 8301403: Eliminate memory allocations in JVMFlag::printFlags during signal handling

Gerard Ziemski gziemski at openjdk.org
Tue Jul 30 15:25:38 UTC 2024


On Tue, 16 Jul 2024 20:44:00 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...

This pull request has now been integrated.

Changeset: a91f9ba8
Author:    Gerard Ziemski <gziemski at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/a91f9ba84906dae10b050e15307ba0f0f05af3e4
Stats:     46 lines in 4 files changed: 12 ins; 10 del; 24 mod

8301403: Eliminate memory allocations in JVMFlag::printFlags during signal handling

Reviewed-by: stuefe, jsjolen, dholmes

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

PR: https://git.openjdk.org/jdk/pull/20202


More information about the hotspot-runtime-dev mailing list