RFR (M): 8035406: Improve data structure for Code Cache remembered sets
thomas.schatzl at oracle.com
Mon Feb 24 03:40:10 PST 2014
can I have reviews for this split-out from 8027295? It changes the
code cache remembered set data structure from a GrowableArray to a set
of chunks of nmethods.
This has two purposes:
- make code cache remembered set reclamation fast, i.e. with the current
implementation instead of malloc/free() just a few pointer operations
are required that are independent of size.
- further in the future, these chunks of nmethods can be used as unit of
distribution across threads to make code root scan less unbalanced
Further implementation details
- caches a number of free chunks in a global free list to avoid
malloc/free overhead of freeing chunks (which is a lot smaller too
because these chunks are evenly sized and small unlike the
- there is a new gc log section that prints code root chunk purge time
to diagnose future problem with that anyway.
- fix a problem that code root freeing was not protected by the
HeapRegionRemSet lock; for that I moved that lock up from
OtherRegionsTable to HeapRegionRemSet.
Alternatives like hash tables did not seem to have advantages: contrary,
they may suffer from the same issues when disposing the hash table array
More information about the hotspot-gc-dev