Skip to content

Commit

Permalink
Ensure ROM class cache shutdown is necessary
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Despres <[email protected]>
  • Loading branch information
cjjdespres committed Jan 24, 2024
1 parent c6ad90e commit 27b0507
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runtime/compiler/runtime/JITClientSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,8 @@ ClientSessionHT::purgeOldDataIfNeeded()
oldAge = OLD_AGE_UNDER_LOW_MEMORY; //memory is low
}
}

bool hadExistingClients = !_clientSessionMap.empty();
// Time for a purge operation.
// Scan the entire table and delete old elements that are not in use
for (auto iter = _clientSessionMap.begin(); iter != _clientSessionMap.end(); ++iter)
Expand All @@ -1241,8 +1243,8 @@ ClientSessionHT::purgeOldDataIfNeeded()
_clientSessionMap.erase(iter); // delete the mapping from the hashtable
}
}
// If all the clients were deleted, shut down the shared ROMClass cache
if (_clientSessionMap.empty())
// If the purge operation was responsible for deleting the last client sessions, shut down the shared ROM class cache as well
if (hadExistingClients && _clientSessionMap.empty())
{
if (auto cache = TR::CompilationInfo::get()->getJITServerSharedROMClassCache())
cache->shutdown();
Expand Down

0 comments on commit 27b0507

Please sign in to comment.