RFR: 8129590: TestShrinkDefragmentedHeap.java runs out of memory

Jon Masamitsu jon.masamitsu at oracle.com
Wed Jul 1 14:48:50 UTC 2015


Stefan,

You raised the question about possible problems when the
maximum heap size is too large for the platform.   Can the number
and size of the small objects be reduced to the minimum that
still makes the test worthwhile and then reduce the maximum
and initial heap sizes accordingly to reduce the chance of
running on a machine with not enough memory?

Jon

On 7/1/2015 6:51 AM, Stefan Johansson wrote:
> Hi,
>
> Please review this test-fix to avoid:
> https://bugs.openjdk.java.net/browse/JDK-8129590
>
> Webrev:
> http://cr.openjdk.java.net/~sjohanss/8129590/hotspot.00/
>
> Summary:
> The test specified the initial heap size and the young generation size 
> but not the maximum heap size. It needs more memory than the initial 
> heap size and in most cases this is not a problem, because the heap 
> can be expanded. But on hosts with very little memory it becomes a 
> problem, because the maximum heap size gets limited to the same size 
> as the initial heap size.
>
> A simple fix for the issue is to set the the maximum heap size to 
> something a little larger than the initial heap size to make sure the 
> expansion is possible. This might come with other problems if the host 
> can't support the needed heap size, but in such cases I think we 
> should avoid running this test.
>
> Testing:
> * Verified fix on failing host.
> * Reproduced failure locally by setting small Xmx and verified that 
> making it larger fixes the issue.
>
> Thanks,
> Stefan



More information about the hotspot-gc-dev mailing list