Review request (S) 7195557 NPG: Unexpected number of memory pools

Mandy Chung mandy.chung at oracle.com
Thu Sep 6 21:59:10 UTC 2012


Mikael,

On 9/6/2012 8:40 AM, Mikael Gerdin wrote:
> On 2012-09-06 17:05, Jon Masamitsu wrote:
>> Mikael,
>>
>> Does the code in CollectionUsageThreshold.java
>> happen to work if perm is the last memory pool
>> in the list and the test
>>
>>   139                 if (result.size() == numMemoryPools) {
>>   140                     break;
>>   141                 }
>>
>> exits the loop having never seen perm (so not incrementing
>> numMemoryPools?
>
> Good point. I'll have to look at this tomorrow. Unfortunately this 
> version of the fix has already been pushed so if we need to fix this 
> I'll open a new CR. 
FYI - the following check was added as part of the fix for:
   4959889 Spec change: Revise low memory detection mechanism

    if (result.size() != EXPECTED_NUM_POOLS) {
        throw new RuntimeException("Unexpected number of selected pools");
    }

I believe L139-141 is a test bug that should have been removed
when the above check was added.  The next time when you modify
this test, it'd be good to consider modernizing this test to
use for-each and generics.  Many of the j.l.m. tests were written
during the development of JDK 5 language support.

Hope this helps.
Mandy





More information about the hotspot-gc-dev mailing list