Class OldGenerationStatusProvider

java.lang.Object
com.github.jpmsilva.jsystemd.OldGenerationStatusProvider
All Implemented Interfaces:
StatusProvider

public class OldGenerationStatusProvider extends Object implements StatusProvider
Implementation of StatusProvider that provides the memory used by the old generation of the heap after the last garbage collection, out of its maximum size (or its committed size, when it has no maximum), such as Old gen after GC: 120.0 MiB/512.0 MiB.

The heap usage reported by the HeapStatusProvider swings with every allocation and collection, while the old generation after a collection only holds the objects that survived: when it keeps growing, the application is likely leaking memory.

The old generation is the heap memory pool named as such by the garbage collector, such as G1 Old Gen or Tenured Gen. Collectors without generations, such as non-generational ZGC or Shenandoah, have a single heap memory pool, which is reported instead. Nothing is reported until the pool is first collected.

Author:
Joao Silva
  • Constructor Details

    • OldGenerationStatusProvider

      public OldGenerationStatusProvider()
      Create a new OldGenerationStatusProvider.
  • Method Details

    • status

      public String status()
      Description copied from interface: StatusProvider
      Exposes status information to send to systemd.
      Specified by:
      status in interface StatusProvider
      Returns:
      the string message to add to the service status