RFR(XS) 8031065: LowMemoryTest2.sh fails: OutOfMemoryError: Metaspace

shanliang shanliang.jiang at oracle.com
Thu Feb 27 03:59:47 PST 2014


Daniel Fuchs wrote:
> On 2/27/14 11:43 AM, Mattias Tobiasson wrote:
>> Hi,
>> Could you please review this test fix.
>>
>> The test verifies that MemoryPoolMXBean sends a notification when 
>> used memory has reached the threshold.
>> The flag thresholdExceeded marks if we have reached the memory 
>> threshold. When the flag is set, the test slows down to give time for 
>> the notification to be received.
>> The problem is that thresholdExceeded is overwritten every time in 
>> the loop. Instead it should be set if any pool has reached the 
>> threshold. This means that the test continues to allocate memory at 
>> full speed, and we may get an OutOfMemory before we get the 
>> notification.
>>
>
> Hi Mattias,
>
> I wonder whether you should also stop calling loadNext() once
> thresholdExceeded is true?
Yes I am thinking this too.

Line 172 is unnecessary, after thresholdExceeded becomes true, Line 170 
will always be skipped.

Shanliang
>
> best regards,
>
> -- daniel
>
>> bug:
>> https://bugs.openjdk.java.net/browse/JDK-8031065
>>
>> webrev:
>> http://cr.openjdk.java.net/~ykantser/8031065/webrev.00/
>>
>> Mattias
>>
>



More information about the serviceability-dev mailing list