My Oracle Support Banner

MemoryPoolMXBean Pool for G1 Pools Report "undefined" Values (Doc ID 2411961.1)

Last updated on MAY 05, 2021

Applies to:

Java SE JDK and JRE - Version 8 and later
Information in this document applies to any platform.


Using G1 Garbage Collection (see [1]) and JVM APIs, the following two memory pools for "max" (see [2]) return -1 or undefined.

  1. G1 Eden Space Type
  2. G1 Survivor Space

This document provides an explanation for the following questions:

  1. Why does getMax() return the undefined value for G1 (see [2] below)? The issue does not happen with the CMS garbage collector.
  2. Are there known defects in this area, if so, please provide the bugid(s)?
  3. Are there other options or workarounds for getting the "max" for the above two memory pools?

The ManagementFactory.getMemoryPoolMXBeans() (see [3]) is used to get the list of MemoryPoolMXBean pools. For each MemoryPoolMXBean, getUsage() (see [4]) is called which returns a MemoryUsage object. The getMax() on this MemoryUsage  returns -1 for G1 Eden Space and G1 Survivor Space.

[1] G1 options used



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.