-
Bug
-
Resolution: Unresolved
-
P5
-
11, 17, 21, 24
The `StartAggressiveSweepingAt` documentation:
```
product(uintx, StartAggressiveSweepingAt, 10, \
"Start aggressive sweeping if X[%] of the code cache is free." \
"Segmented code cache: X[%] of the non-profiled heap." \
"Non-segmented code cache: X[%] of the total code cache") \
```
It says that in a case of the segmented code cache the percent of the free space of the non-profile heap is used to trigger sweeping.
This is incorrect because according to the code: https://github.com/openjdk/jdk/blob/996790c70f902d7840d0649a6b0867bed47c6537/src/hotspot/share/code/codeCache.cpp#L782
```
void CodeCache::gc_on_allocation() {
...
size_t free = unallocated_capacity();
size_t max = max_capacity();
size_t used = max - free;
double free_ratio = double(free) / double(max);
if (free_ratio <= StartAggressiveSweepingAt / 100.0) {
```
the usage of all allocable heaps is taken into account. `unallocated_capacity` and `max_capacity` traverse all such code heaps.
```
product(uintx, StartAggressiveSweepingAt, 10, \
"Start aggressive sweeping if X[%] of the code cache is free." \
"Segmented code cache: X[%] of the non-profiled heap." \
"Non-segmented code cache: X[%] of the total code cache") \
```
It says that in a case of the segmented code cache the percent of the free space of the non-profile heap is used to trigger sweeping.
This is incorrect because according to the code: https://github.com/openjdk/jdk/blob/996790c70f902d7840d0649a6b0867bed47c6537/src/hotspot/share/code/codeCache.cpp#L782
```
void CodeCache::gc_on_allocation() {
...
size_t free = unallocated_capacity();
size_t max = max_capacity();
size_t used = max - free;
double free_ratio = double(free) / double(max);
if (free_ratio <= StartAggressiveSweepingAt / 100.0) {
```
the usage of all allocable heaps is taken into account. `unallocated_capacity` and `max_capacity` traverse all such code heaps.
- relates to
-
JDK-8046809 vm/mlvm/meth/stress/compiler/deoptimize CodeCache is full.
- Closed