[JDK-8374045](https://bugs.openjdk.org/browse/JDK-8374045)

This PR adds a new utility tool CodeCacheFragmenter to help with testing 
HotSpot code cache fragmentation scenarios. The tool is a Java agent that uses 
the WhiteBox API to create and randomly free dummy code blobs in the 
NonProfiled code heap to achieve a specified fill percentage. It includes 
configurable parameters for blob sizes, target fill percentage (0-100%), and 
random seeding to enable reproducible fragmentation patterns. The utility is 
built via a standard Makefile and produces `codecachefragmenter.jar` which can 
be used as a Java agent with `-javaagent` flag. This tool is intended for 
performance testing and experimentation with code cache behavior under various 
fragmentation conditions.

This is useful to show the performance benefits of 
[JDK-8326205](https://bugs.openjdk.org/browse/JDK-8326205)

With the same amount of free code cache memory, adding fragmentation increases 
execution time of Renaissance Dotty by ~5x. See 
https://github.com/openjdk/jdk/pull/28934#issuecomment-3820151693 for more 
details.

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

Commit messages:
 - Merge remote-tracking branch 'origin/master' into CodeCacheFragAgent
 - Small improvements
 - Make README markdown
 - Implement build system
 - Add CodeCacheFragAgent

Changes: https://git.openjdk.org/jdk/pull/28934/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28934&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8374045
  Stats: 331 lines in 5 files changed: 331 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28934.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28934/head:pull/28934

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

Reply via email to