JDK-8317683 : Add JIT memory statistics
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-10-06
  • Updated: 2024-07-24
  • Resolved: 2023-10-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22 b20Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
We need to know arena usage for individual compilations to understand compiler footprint. The compiler can cause malloc spikes, that can cause lasting memory retention in the underlying libc.

NMT is okay for initial triaging but no help when digging deeper into compiler footprint. NMT shows how much native memory the JIT uses but lumps together footprints from concurrent compilations, making its peak values arbitrary. And we have no way to associate the NMT numbers with individual allocations.

This RFE is a proposal for a new statistic that reports memory usage per compilation. That will allow us to understand footprint issues and libc mem retention better and can be the first step in footprint reductions or, potentially, for adding a memory ceiling to C2.


Examples:

1) Enable memory statistics globally

```
java ... -XX:CompileCommand=MemStat,*.*
```

2) Enable memory statistics for j.l.String, print logs after each compilation and a final report at VM exit:

```
-XX:CompileCommand=MemStat,java.lang.String::*,print
```




Comments
Changeset: 56aa1e8d Author: Thomas Stuefe <stuefe@openjdk.org> Date: 2023-10-14 05:56:52 +0000 URL: https://git.openjdk.org/jdk/commit/56aa1e8dc8047cbc29d554889c64beb6eca0b8eb
14-10-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16076 Date: 2023-10-06 17:31:21 +0000
10-10-2023