mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8181859: Monitor deflation is not checked in cleanup path
Reviewed-by: sspitsyn, dcubed, shade, cvarming
This commit is contained in:
parent
2a0bd0cd04
commit
0d3624a309
4 changed files with 25 additions and 1 deletions
|
@ -962,6 +962,21 @@ static inline ObjectMonitor* next(ObjectMonitor* block) {
|
|||
return block;
|
||||
}
|
||||
|
||||
static bool monitors_used_above_threshold() {
|
||||
if (gMonitorPopulation == 0) {
|
||||
return false;
|
||||
}
|
||||
int monitors_used = gMonitorPopulation - gMonitorFreeCount;
|
||||
int monitor_usage = (monitors_used * 100LL) / gMonitorPopulation;
|
||||
return monitor_usage > MonitorUsedDeflationThreshold;
|
||||
}
|
||||
|
||||
bool ObjectSynchronizer::is_cleanup_needed() {
|
||||
if (MonitorUsedDeflationThreshold > 0) {
|
||||
return monitors_used_above_threshold();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ObjectSynchronizer::oops_do(OopClosure* f) {
|
||||
if (MonitorInUseLists) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue