Additional tests for humongous objects in G1 

One of the long-favored features of the Java platform is the behind-the-scenes garbage collection. An improvement goal was to create additional WhiteBox tests for humongous objects as a feature of the G1 garbage collector.

WhiteBox testing is an API used to query JVM internals. The WhiteBox testing API was introduced in Java 7 and upgraded in Java 8 and Java 9.

The G1 garbage collector worked extremely well, but there was room for some improved efficiency. The way the G1 garbage collector worked was based on first dividing the heap into regions of equal size, illustrated as follows:

The problem with the G1 garbage collector was how humongous objects were handled.

A humongous object, in the context of garbage collection, is any object that takes up more than one region on the heap.

The problem with humongous objects was that if they took up any part of a region on the heap, the remaining space was not able to be allocated for other objects. In Java 9, the WhiteBox API was extended with four types of new methods:

  • Methods with the purpose of blocking full garbage collection and initiating concurrent marking.
  • Methods that can access individual G1 garbage collection heap regions. Access to these regions consist of attribute reading, such as with the current state of the region.
  • Methods with direct access to the G1 garbage collection internal variables.
  • Methods that can determine if humongous objects reside on the heap and, if so, in what regions.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset