On Thu, 18 Mar 2021 12:09:25 GMT, Ralf Schmelter <rschmel...@openjdk.org> wrote:

>> Lin Zang has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   reduce memory consumption and fix memory leak issue
>
> src/hotspot/share/services/heapDumper.cpp line 1741:
> 
>> 1739:   uint length() { return _length; }
>> 1740: 
>> 1741:   static const size_t LargeObjectSizeThreshold = 128 * (1 << 20); // 
>> 128 MB
> 
> I think this threshold is much too large. I've instrumented the code to track 
> the maximum memory use of the buffers and tested the max memory use and the 
> performance for 2, 4 and 8 parallel iteration threads and for a threshold of 
> 128 MB and 1 MB (using my scenario with a 32 GB heap):
> 
> 128 MB threshold:
> 2 threads -> 57 MB max memory, 64.6 seconds duration
> 4 threads -> 88 MB max memory, 40.5 seconds duration
> 8 threads -> 170 MB max memory, 29.6 seconds duration
> 
> 1MB threshold:
> 2 threads -> 8 MB max memory, 64.6 seconds duration
> 4 threads -> 15 MB max memory, 39.5 seconds duration
> 8 threads -> 32 MB max memory, 28.9 seconds duration
> 
> As you can see, using a much lower threshold has no discernable performance 
> impact, but uses a lot less memory. Also note that the memory consumption can 
> be much higher in the worst case scenario.

I agree, Thanks for the evaluation!  I think 1MB is reasonable. Will made the 
change in next update.

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

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

Reply via email to