Skip to content

Commit

Permalink
8284404: Too aggressive sweeping with Loom
Browse files Browse the repository at this point in the history
Reviewed-by: kvn, thartmann
  • Loading branch information
fisk committed Jun 20, 2022
1 parent 47b8669 commit 7d4df6a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/hotspot/share/compiler/compilerDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "runtime/arguments.hpp"
#include "runtime/continuation.hpp"
#include "runtime/flags/jvmFlag.hpp"
#include "runtime/flags/jvmFlagAccess.hpp"
#include "runtime/flags/jvmFlagConstraintsCompiler.hpp"
Expand Down Expand Up @@ -594,7 +595,13 @@ void CompilerConfig::ergo_initialize() {
#endif

if (FLAG_IS_DEFAULT(SweeperThreshold)) {
if ((SweeperThreshold * ReservedCodeCacheSize / 100) > (1.2 * M)) {
if (Continuations::enabled()) {
// When continuations are enabled, the sweeper needs to trigger GC to
// be able to sweep nmethods. Therefore, it's in general a good idea
// to be significantly less aggressive with sweeping, in order not to
// trigger excessive GC work.
FLAG_SET_ERGO(SweeperThreshold, SweeperThreshold * 10.0);
} else if ((SweeperThreshold * ReservedCodeCacheSize / 100) > (1.2 * M)) {
// Cap default SweeperThreshold value to an equivalent of 1.2 Mb
FLAG_SET_ERGO(SweeperThreshold, (1.2 * M * 100) / ReservedCodeCacheSize);
}
Expand Down

1 comment on commit 7d4df6a

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.