Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balanced GC improvements for better utilization of fragmented memory #9247

Closed
LinHu2016 opened this issue Apr 14, 2020 · 2 comments · Fixed by #11862
Closed

Balanced GC improvements for better utilization of fragmented memory #9247

LinHu2016 opened this issue Apr 14, 2020 · 2 comments · Fixed by #11862
Labels

Comments

@LinHu2016
Copy link
Contributor

Balanced GC is region base GC policy, in general partial garbage collector(PGC) would handle most reclaim memory, occasionally global marking phase(GMP) starts and interleaves with the PGCs, global GC and abort case in PGC should be minimum for the better performance. Logically
after GMP, JVM should have more free memory than usual, but the first PGC after GMP has more chance to get abort case(specially when region count is low, such as region count=64, there are 70% abort cases happened during the first PGC after GMP), apparently there is some free memory we can not to reuse in the case.

1, After global sweep, the memory in the regions is freed, but Balanced GC use BumpPointer memorypool for allocation, only "free tail" can be reused for GC allocation, there is no freelist to track free memory in middle of region, the region need to be compacted or collected by PGC, then the free memory can be used.

2, After GMP, the cards reference from "free memory" have not be pruned from InterRegionRememberedsets, it prevents to reuse any free memory(includes free tail) in collected regions by GMP.

@LinHu2016
Copy link
Contributor Author

#8804 fixed the second problem(pruning cards from InterRegionRememberedsets).

@LinHu2016
Copy link
Contributor Author

LinHu2016 commented Feb 24, 2021

The below some of things/optimizations that we will defer from first implementation.
1, better handle recycling remanining cache, maybe can connect to one exist free memory or build thread local list of remainders(per compactGroup) in discardRemainingCache().
2, handle the case region->hasValidMarkMap() for further performance optimization in clearMarkMapForPartialCollect(), there are 2-3 spots genrally in copy foward code where we would still benefit from knowing where the boundary is (either the possition of first free chunk, or position of last object).
3, MemoryPoolBumpPointer has been replaced with MemoryPoolAddressOrderedList, regionType (BUMP_ALLOCATED, BUMP_ALLOCATED_IDLE, BUMP_ALLOCATED_MARKED) have been replaced with regionType ADDRESS_ORDERED, BumpPointer MemoryPool and BUMP_ALLOCATEDs are not used anymore, remove them, caution: DDR need them for back compatible.
4, _noCompactionAfterSweep in MM_CycleState is VLHGC specific flag and ideally should go to existing MM_CycleStateVLHGC class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants