RFR (XS): JDK-8013496: Code cache management command line options work only in special order. Another order of arguments does not deliver the second parameter to the jvm.

Vladimir Kozlov vladimir.kozlov at oracle.com
Fri May 3 14:59:11 PDT 2013


Albert,

After looking on this code more I think the message in the flag parsing 
code (at line 2453) should be different. It should say nothing about 
minimum value because the value check will be done later in 
check_vm_args_consistency(). It should only check that value is positive 
which parse_memory_size() does with parameter 1.
Please, remove "Should be greater than 1K" from message (at line 2453).

Also use ReservedCodeCacheSize in the message in 
check_vm_args_consistency() so the user can see what he needs to adjust:

"Invalid ReservedCodeCacheSize: %dK. Should be greater than 
InitialCodeCacheSize=%dK\n"

On 5/3/13 10:26 AM, Albert Noll wrote:
> Hi Vladimir,
> thank you for the feedback. I tried to execute a simple "Hello World" on
> my system.
> - with "-Xint": 2MB are fine
> - with "-XX:+TieredCompilation" and 2MB, hotspot crashes:
>    #  Internal Error
> (/export/anoll/JDK-8013496/src/share/vm/c1/c1_Compiler.cpp:87),
> pid=23449, tid=140038076614400
>    #  guarantee(blob != NULL) failed: must create initial code buffer
> - with "-XX:+TieredCompilation" and 2.1MB: fine
>
> Interestingly, "java -Xint -XX:+TieredCompilation" is legal too. I guess
> we should change that too.

Why? It is legal to run Server VM only in Interpreter mode. 
-XX:+TieredCompilation only means that we use C1 compiler for generating 
code which do profiling instead of using Interpreter for profiling.

Thanks,
Vladimir

>
> How about a minimum code cache size of 4MB?
>
> Best,
> Albert
>
> On 05/03/2013 05:07 PM, Vladimir Kozlov wrote:
>> My latest check of used codecache before JIt compilation shows that
>> more than 1Mb was used (template interpreter, stubs, adapters). I
>> think 1K is too small. Run (for example, on sparc) a small program
>> with -Xint to see how much you need. Also we have and
>> CodeCacheMinimumFreeSpace=500k parameter. So I would guess we need
>> something around 2Mb to run VM in interpreter mode.
>>
>> Otherwise changes are good.
>>
>> Thanks,
>> Vladimir
>>
>> On 5/3/13 5:54 AM, Albert Noll wrote:
>>> Hi,
>>>
>>> please review the patch.
>>>
>>> Many thanks in advance,
>>> Albert
>>>
>>> jbs: https://jbs.oracle.com/bugs/browse/JDK-8013496
>>> webrev: http://cr.openjdk.java.net/~adlertz/JDK-8013496/webrev00/
>>>
>>> Problem:
>>> The order in which the arguments  "-XX:ReservedCodeCacheSize=1m" and
>>> "-XX:InitialCodeCacheSize=500k"
>>> are given to hotspot mattered. In particular, the above order resulted
>>> in an error:
>>>
>>> Invalid maximum code cache size: -XX:ReservedCodeCacheSize=1m. Should be
>>> greater than InitialCodeCacheSize=2496K
>>> Error: Could not create the Java Virtual Machine.
>>> Error: A fatal exception has occurred. Program will exit.
>>>
>>> Fix: Moved the check: ReservedCodeCacheSize >= InitialCodeCacheSize to
>>> Arguments::check_vm_args_consistency()
>>> (as suggested in the comment).
>>>
>>> Currently, the minimum ReservedCodeCacheSize is 1K. Any thoughts on
>>> that?
>>>
>>>
>>>
>


More information about the hotspot-compiler-dev mailing list