What are ReservedCodeCacheSize and InitialCodeCacheSize?

后端 未结 4 844
你的背包
你的背包 2020-11-29 18:56

Can someone please explain what the JVM option ReservedCodeCacheSize and InitialCodeCacheSize are? Specifically when/why would I want to change it?

4条回答
  •  孤街浪徒
    2020-11-29 19:23

    from https://blogs.oracle.com/poonam/entry/why_do_i_get_message:

    The following are two known problems in jdk7u4+ with respect to the CodeCache flushing:

    1. The compiler may not get restarted even after the CodeCache occupancy drops down to almost half after the emergency flushing.
    2. The emergency flushing may cause high CPU usage by the compiler threads leading to overall performance degradation.

    This performance issue, and the problem of the compiler not getting re-enabled again has been addressed in JDK8. To workaround these in JDK7u4+, we can increase the code cache size using ReservedCodeCacheSize option by setting it to a value larger than the compiled-code footprint so that the CodeCache never becomes full. Another solution to this is to disable the CodeCache Flushing using -XX:-UseCodeCacheFlushing JVM option.

    The above mentioned issues have been fixed in JDK8 and its updates.

    So that information might be worth mentioning for systems running on JDK 6 (having code flushing disabled) and 7.

提交回复
热议问题