Make SyscallCache a constant over the lifetime of the server: it was already effectively a constant, but we initialized it based on the value of --legacy_globbing_threads on the first invocation that did package loading. That never really made much sense (initial capacity != concurrency) and anyway with Skyframe --legacy_globbing_threads isn't the controlling knob for concurrent accesses to the SyscallCache, since it's accessed directly in Skyframe.
Moreover, the memory cost of an overly large initial capacity is negligible (8 bytes per entry), so we just change it to cost (JVM heap)/1M.
It was a mistake to notice this only after https://github.com/bazelbuild/bazel/commit/491e4418c225d224466c2211f608b42241c6c55a: this changes many of the same lines.
PiperOrigin-RevId: 426688249
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/BlazeRuntimeTest.java b/src/test/java/com/google/devtools/build/lib/runtime/BlazeRuntimeTest.java
index 3639fe9..799d156 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/BlazeRuntimeTest.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/BlazeRuntimeTest.java
@@ -28,6 +28,7 @@
import com.google.devtools.build.lib.util.DetailedExitCode;
import com.google.devtools.build.lib.vfs.DigestHashFunction;
import com.google.devtools.build.lib.vfs.FileSystem;
+import com.google.devtools.build.lib.vfs.SyscallCache;
import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem;
import com.google.devtools.common.options.OptionsBase;
import com.google.devtools.common.options.OptionsParser;
@@ -103,6 +104,7 @@
commandThread,
VersionCommand.class.getAnnotation(Command.class),
options,
+ SyscallCache.NO_CACHE,
ImmutableList.of(),
0L,
0L,
@@ -151,6 +153,7 @@
Thread.currentThread(),
VersionCommand.class.getAnnotation(Command.class),
OptionsParser.builder().optionsClasses(COMMAND_ENV_REQUIRED_OPTIONS).build(),
+ SyscallCache.NO_CACHE,
ImmutableList.of(),
0L,
0L,