[9] RFR(XS): 8059596: VM startup fails with 'Invalid code heap sizes' if -XX:ReservedCodeCacheSize is set

Tobias Hartmann tobias.hartmann at oracle.com
Fri Nov 14 11:41:05 UTC 2014


Hi Vladimir,

On 14.11.2014 02:13, Vladimir Kozlov wrote:
> Hi Tobias,
> 
> At the line 1149 we set ReservedCodeCacheSize to ERGO so it is not DEFAULT anymore:
> 
> 1149     FLAG_SET_ERGO(uintx, ReservedCodeCacheSize, ReservedCodeCacheSize * 5);
> 
> As result segments sizes are not set there. They will be set to in
> CodeCache::initialize_heaps() as (ReservedCodeCacheSize -
> NonNMethodCodeHeapSize) / 2:
> 
> CodeHeap 'non-nmethods': size=5700Kb used=2278Kb max_used=2279Kb free=3421Kb
> CodeHeap 'profiled nmethods': size=120032Kb used=120Kb max_used=120Kb free=119912Kb
> CodeHeap 'non-profiled nmethods': size=120032Kb used=22Kb max_used=22Kb free=120
> 
> But it is not *5 sizes:
> 
> define_pd_global(intx, NonProfiledCodeHeapSize,      21*M);
> define_pd_global(intx, ProfiledCodeHeapSize,         22*M);
> 
> And it skips the assert in arguments.cpp

Thanks for pointing that out. As Vladimir I. already suggested, I will move the
logic into CodeCache::initialize_heaps() and check consistency there.

I filed JDK-8059611 for that.

Thanks,
Tobias

> 
> Vladimir
> 
> On 10/2/14 2:17 AM, Tobias Hartmann wrote:
>> Hi,
>>
>> please review this small patch.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8059596
>> Webrev: http://cr.openjdk.java.net/~thartmann/8059596/webrev.00/
>>
>> Problem:
>> The VM startup fails with 'Invalid code heap sizes' if
>> -XX:ReservedCodeCacheSize >= 240M is specified. The problem is that in
>> Arguments::set_tiered_flags() the code cache size is increased by 5 if
>> TieredCompilation is enabled. This should only be done for default values.
>>
>> Solution:
>> Add missing FLAG_IS_DEFAULT(ReservedCodeCacheSize) check.
>>
>> Thanks,
>> Tobias


More information about the hotspot-dev mailing list