RFR (S): 8014972: Crash with specific values for -XX:InitialCodeCacheSize=500K -XX:ReservedCodeCacheSize=500k
Vladimir Kozlov
vladimir.kozlov at oracle.com
Thu Jun 20 13:27:23 PDT 2013
Albert,
Please, place new flag in globals.hpp after InitialCodeCacheSize
definition since they are related.
MinimumInitialCodeCacheSize should be MinimumCodeCacheSize.
We also asked to check upper limit since we can use > 2Gb (MAXINT) size
for CodeCache.
Also your changes could be much simpler if you just add the check
(InitialCodeCacheSize < min_code_cache_size) before existing check
(ReservedCodeCacheSize < InitialCodeCacheSize).
And, please, don't use different message for debug build.
'* 3' for debug build could be done as:
uint min_code_cache_size = MinimumInitialCodeCacheSize DEBUG_ONLY(* 3) +
CodeCacheMinimumFreeSpace;
thanks,
Vladimir
On 6/20/13 4:02 AM, Albert Noll wrote:
> Hi,
>
> thanks for reviewing this small patch.
>
> Albert
>
> jbs: https://jbs.oracle.com/bugs/browse/JDK-8014972
> webrev: http://cr.openjdk.java.net/~anoll/8014972/webrev.00/
> <http://cr.openjdk.java.net/%7Eanoll/8014972/webrev.00/>
>
>
> Problem:
> If -XX:ReservedCodeCacheSize is set too small, the VM crashes when
> starting up.
>
> Solution:
> Introduce a minimum code cache size (ReservedCodeCacheSize) that
> guarantees that the VM can startup. The minimum code cache size is
> defined by a new parameter (MinimumInitialCodeCacheSize) that cannot be
> changed in product build. My reasoning for this is that smaller values
> make the JVM crash at startup. However, in a development build, the
> parameter can be changed.
>
> The current patch sets MinimumInitialCodeCacheSize to 400k for all
> platforms. On Solaris, MinimumInitialCodeCacheSize could be set to 300k
> and the VM still starts up. However, I am not sure if it makes sense to
> make MinimumInitialCodeCacheSize platform-dependent so that we can
> potentially save 100k on Solaris. If there is a reason, please let me know.
>
> Also note that the InitialCodeCacheSize must be > 0. The reason is that
> otherwise the following assertion fails:
>
> Internal Error
> (/tmp/workspace/2-build-solaris-i586/jdk8/4767/hotspot/src/share/vm/memory/heap.cpp:50),
> pid=27190, tid=2
> # assert(0 <= beg && beg < _number_of_committed_segments) failed:
> interval begin out of bounds
>
>
> Testing:
> With the current value of MinimumInitialCodeCacheSize, the VM starts up
> on all Windows, Linux, and Solaris.
>
> Note that we can still get exceptions (and the JVM cannot continue to
> execute) if the value for CodeCacheMinimumFreeSpace is to small (in that
> case, here is not enough space for adapters) .
More information about the hotspot-compiler-dev
mailing list