RFR 8204525: [TESTBUG] runtime/NMT/MallocStressTest.java ran out of java heap
Harold David Seigel
harold.seigel at oracle.com
Mon Nov 26 14:34:09 UTC 2018
Thanks David!
Harold
On 11/21/2018 8:39 PM, David Holmes wrote:
> Hi Harold,
>
> On 21/11/2018 11:08 pm, Harold David Seigel wrote:
>> Hi David,
>>
>> Thanks for looking at this change.
>>
>> When growing the mallocd_memory array list, the JDK creates a
>> completely new copy. This can a large allocation and is more likely
>> to cause an OutOfMemoryException than the small println() call.
>
> Sure, but you have many of these threads running at once so the heap
> could be being exhausted in one thread at the same time as another
> hits the malloc limit and goes to do the println. And println can
> trigger a lot of memory use on its first use.
>
>> But, since the println() call could be the proverbial straw that
>> breaks the camel's back, how about if I just remove the println() call?
>
> Works for me. :)
>
> Thanks,
> David
>
>> Thanks, Harold
>>
>>
>> On 11/20/2018 5:44 PM, David Holmes wrote:
>>> Hi Harold,
>>>
>>> Fix seems reasonable but the problem suggests that the test could
>>> still fail spuriously if it runs out of Java heap around the same
>>> time as malloc'd memory - the println will throw OOME.
>>>
>>> Cheers,
>>> David
>>>
>>> On 21/11/2018 12:46 am, Harold David Seigel wrote:
>>>> Hi,
>>>>
>>>> Please review this small change to fix test bug JDK-8204525. Test
>>>> MallocStressTest quickly allocates lots of malloc memory and slowly
>>>> releases it. It checks that NMT properly measures the amount of
>>>> allocated memory. The test occasionally fails when it runs out of
>>>> Java heap before the malloc memory allocations completed.
>>>>
>>>> The test has several threads that loop, allocating lots of memory.
>>>> A thread's allocations stop when its malloc allocation fails, or
>>>> when a certain amount of time expires. This fix also stops a
>>>> thread's allocation when an OutOfMemoryError exception gets thrown.
>>>>
>>>> Open Webrev: http://cr.openjdk.java.net/~hseigel/bug_8204525/webrev/
>>>>
>>>> JBS Bug: https://bugs.openjdk.java.net/browse/JDK-8204525
>>>>
>>>> The fix was tested on Linux X64, Windows, Solaris, and Mac. It was
>>>> also tested on Linux X64 with -Xmx20M, which, before this fix,
>>>> reliably reproduced the failure.
>>>>
>>>> Thanks, Harold
>>>>
>>
More information about the hotspot-runtime-dev
mailing list