RFR: JDK-8261297: NMT: Final report should use scale 1

Zhengyu Gu zgu at openjdk.java.net
Wed Feb 10 13:21:41 UTC 2021


On Mon, 8 Feb 2021 08:15:21 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> If PrintNMTStatistics is specified, we write a NMT report to stdout before exiting the VM. This is useful for leak analysis.
> 
> However, the report uses the standard "K" scale, which is shouldn't, since this omits small leaks < 1K. Hence it should use scale=1. This would provide us with a precise exit report. Note that for this to work JDK-8261238 has to be fixed too, which is a separate issue.
> 
> This patch:
> - changes the scale of the final report to 1
> - does some minor cleanup work in the MemReporter class hierarchy (const-ifying scale and the output stream, and establishing 0 as "default scale" as to avoid having the default scale hard coded in four places.

Sorry for the delay.

src/hotspot/share/services/memReporter.hpp line 48:

> 46:  public:
> 47:   // scale = 0 -> default scale
> 48:   MemReporterBase(outputStream* out = NULL, size_t scale = 0) :

Why you want to default scale parameter to 0, instead of default_scale?

src/hotspot/share/services/memTracker.hpp line 119:

> 117: 
> 118:  public:
> 119: 

Unrelated?

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

Changes requested by zgu (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/2450


More information about the hotspot-runtime-dev mailing list