RFR: JDK-8202788: Explicitly reclaim cached thread-local direct buffers at thread exit

Peter Levart peter.levart at gmail.com
Thu Jun 21 16:59:55 UTC 2018



On 06/21/2018 06:17 PM, Tony Printezis wrote:
> I was saying: I looked at TestMaxCachedBufferSize and, unfortunately, 
> I don’t think the test makes a lot of sense right now as it checks the 
> number / size of direct buffers after all the threads terminate and, 
> with this change, that should always be 0.

You're right. The test makes no sense now. As I understand, the test 
checked that number/size of allocated temporary buffers did not exceed 
the estimated calculated size by checking the MXBean immediately after 
threads terminate. This will never happen after the change as they will 
all be freed before checking, regardless of how many were and how much 
was allocated.

Perhaps the test should be modified to include a latch so that threads 
wait until the measurement is made and only then are allowed to exit...

Regards, Peter



More information about the core-libs-dev mailing list