Mohit Tyagi Mohit Tyagi - 3 years ago 150
Java Question

How to resolve segmented code cache related memory issues in Java 9?

Segmented code cache is a new feature introduced in Java 9 that divides the code cache into segments, this improves performance to a considerable extent. But there can be some memory wastage due to fixed size per code heap, in case of small code cache, one code heap is full and there is still space in another code heap.

So what are possible workarounds to overcome these memory issues?

Answer Source

The Risks and Assumptions of the Segmented Code Cache JEP states the same in a cleaner way:-

Having a fixed size per code heap leads to a potential waste of memory in case one code heap is full and there is still space in another code heap. Especially for very small code cache sizes, it may happen that the compilers are shut off even if there is still space available. To solve this problem an option will be added to turn off the segmentation for small code-cache sizes.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download