-
Enhancement
-
Resolution: Fixed
-
P4
-
19
-
b12
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8317539 | 17.0.10 | Goetz Lindenmaier | P4 | Resolved | Fixed | b01 |
NMT backend can be further simplified and cleaned out.
- some entry points require the nmt tracking level, some use the internal global tracking level. Ultimately, every part of NMT always uses the global tracking level, so in many cases we can remove method arguments where the tracking level is passed in.
- `MemTracker::malloc_header_size(level)` + `MemTracker::malloc_footer_size(level)` can be fused into a single function
- when putting stuff into the `MallocSiteTable`, it hands out a shortcut to the entry containing the callstack. That shortcut is stored verbatim in the malloc header. It consists of two 16-bit values (bucket index and chain position). That tupel finds its way as arguments into many functions. It can be simplified into single 32-bit opaque marker. Code outside the MallocSiteTable does not need to know what it is.
- Currently, the `MallocHeader` class contains a lot of logic. It takes care, in the constructor and in `MallocHeader::release()`, of the actual accounting work. It would simplify the code if `MallocHeader` were just a dumb data carrier and the `MallocTracker` would do the actual work.
- `MallocHeader` can be simplified, almost all members made constant and modifying accessors removed.
- In a number of places we handle argument errors gracefully where we should assert instead
- In a number of places expressions like `MemTracker::tracking_level() != NMT_off` can be simplified to `MemTracker::enabled()`.
- MemTracker::malloc_base (all variants) can be removed. Note that we have MallocTracker::malloc_header, which achieves the same and does not require casting to the header.
- some entry points require the nmt tracking level, some use the internal global tracking level. Ultimately, every part of NMT always uses the global tracking level, so in many cases we can remove method arguments where the tracking level is passed in.
- `MemTracker::malloc_header_size(level)` + `MemTracker::malloc_footer_size(level)` can be fused into a single function
- when putting stuff into the `MallocSiteTable`, it hands out a shortcut to the entry containing the callstack. That shortcut is stored verbatim in the malloc header. It consists of two 16-bit values (bucket index and chain position). That tupel finds its way as arguments into many functions. It can be simplified into single 32-bit opaque marker. Code outside the MallocSiteTable does not need to know what it is.
- Currently, the `MallocHeader` class contains a lot of logic. It takes care, in the constructor and in `MallocHeader::release()`, of the actual accounting work. It would simplify the code if `MallocHeader` were just a dumb data carrier and the `MallocTracker` would do the actual work.
- `MallocHeader` can be simplified, almost all members made constant and modifying accessors removed.
- In a number of places we handle argument errors gracefully where we should assert instead
- In a number of places expressions like `MemTracker::tracking_level() != NMT_off` can be simplified to `MemTracker::enabled()`.
- MemTracker::malloc_base (all variants) can be removed. Note that we have MallocTracker::malloc_header, which achieves the same and does not require casting to the header.
- backported by
-
JDK-8317539 Further simplify NMT backend
-
- Resolved
-
- relates to
-
JDK-8313708 NMT: cleanup _mst_marker
-
- Closed
-
- links to
-
Commit openjdk/jdk17u-dev/aa547501
-
Commit openjdk/jdk/b96b7437
-
Review openjdk/jdk17u-dev/1820
-
Review openjdk/jdk/7283
(1 links to)