Class StorageBenchmark
CachedStorage + OwnerResidencyCache + ChestCacheState).
Unlike the offline JUnit simulation this replaces, it runs inside the live Paper/Folia
server process: the real JVM, the real thread scheduler, the real GC. It drives the actual
production storage classes over an isolated throwaway SQLite database in
plugins/EnhancedEchest/benchmark/ — never the live data — so it measures the engine as it
really behaves without any risk to a real player's chests. The DB and its files are deleted when
the run ends.
Two memory numbers are reported and answer different questions:
- Alloc/op — bytes allocated on the calling thread per operation, read from
ThreadMXBean. This is GC pressure: how much garbage one operation produces. - Retained — live heap held after the operation, a GC-settled
Runtimedelta. This is where a leak shows up, and it is what proves "memory ∝ online players".
The whole run is blocking and does real disk I/O plus System.gc() settling, so it must
be invoked off the main server thread (the command dispatches it to a dedicated thread).
It is gated to local developer builds only (see the bootstrap).
-
Method Summary
-
Method Details
-
run
Runs the whole suite. Blocking; call from a dedicated thread. Progress and the final report are streamed tosenderand also written toplugins/EnhancedEchest/benchmark/…txt.
-