Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8324823

G1: Provide automated way to check for pin count underflows

XMLWordPrintable

    • gc

      G1 maintains a pin count value for every region that indicates how many times an object has been pinned in a region.

      Typically these calls to pin/unpin (Get/ReleasePrimitiveCritical) need to be paired exactly to avoid memory leaks (the region can't be reclaimed while the pin count != 0).

      Currently gc+heap+region=trace provides a way to monitor the region's pin count, allowing a user to track pin counts. This makes debugging issues in that area possible, but tedious.

      For a bit more convenience we could add a pin count "red zone", particularly in the negative range (-1 ... -4096 - random numbers) where if the aggregated pin count is within that area, error out.

      Maybe guarded with CheckJNI or something flag.

            Unassigned Unassigned
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: