Details
-
Bug
-
Resolution: Fixed
-
P4
-
11, 13, 14
-
b24
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8263785 | 11.0.12 | Lucy Schmidt | P4 | Resolved | Fixed | b01 |
Description
The issue can be observed with large CodeHeaps (> 1GB) and tests which create a somewhat pathological pattern in the CodeHeap. One example would be test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java
This tests fills the CodeHeap with approx. 10**5 code blobs until a "CodeHeap full" condition is reached. All previously created code blobs are then freed again. As there are no other code blobs in the heap, the freeing process creates an ever growing single free block.
The performance issue has two components:
non-PRODUCT only: CodeHeap::invalidate() is called in merge_right() after joining the currently freed block with the previously existing one. This is an O(n*n) effort, and it's useless. The contents of the previously existing free block has already been invalidated.
CodeHeap::mark_segmap_as_used() updates the segment map after the two free blocks have been joined. This is an O(n*n) effort as well, and it can't be saved. It should be optimized as good as possible to prevent the non-linear effect from kicking in (too early).
This tests fills the CodeHeap with approx. 10**5 code blobs until a "CodeHeap full" condition is reached. All previously created code blobs are then freed again. As there are no other code blobs in the heap, the freeing process creates an ever growing single free block.
The performance issue has two components:
non-PRODUCT only: CodeHeap::invalidate() is called in merge_right() after joining the currently freed block with the previously existing one. This is an O(n*n) effort, and it's useless. The contents of the previously existing free block has already been invalidated.
CodeHeap::mark_segmap_as_used() updates the segment map after the two free blocks have been joined. This is an O(n*n) effort as well, and it can't be saved. It should be optimized as good as possible to prevent the non-linear effect from kicking in (too early).
Attachments
Issue Links
- backported by
-
JDK-8263785 Performance issue (CodeHeap) with large free blocks
- Resolved
- relates to
-
JDK-8264223 CodeHeap::verify fails extra_hops assertion in fastdebug test
- Resolved
-
JDK-8223444 Improve CodeHeap Free Space Management
- Resolved