Reducing metaspace waste

Currently, when metaspace chunks are freed, they cannot be used as different sized chunks. So, if metaspace chunk A was freed and was of size X, that space cannot be reused for a metaspace chunk greater than or less than size X. This results in a tremendous amount of unusable metaspace waste. This can also lead to out-of-memory errors.

A future change to the JDK will resolve this issue by increasing the reuse of metaspace chunks. The change will support the following cases:

  • Allow neighboring chunks to form a larger chunk
  • Allow larger chunks to be divided into smaller chunks

This proposed change resolves the issue by ensuring smaller chunks can be reused and that larger chunks are not wasted as they can be split ...

Get Java 9: Building Robust Modular Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.