Class RuntimeMemory
java.lang.Object
io.deephaven.engine.table.impl.util.RuntimeMemory
Cache memory utilization.
Calling Runtime.getRuntime().freeMemory() is expensive; and we may do it a lot when we have automatically computed tables, such as in a partitionBy. Instead of calling the runtime directly from the performance instrumentation framework, we call this class's methods; which cache the result for a configurable number of milliseconds to avoid repeated calls that are not likely any different.
Additionally, we log our JVM heap usage on a regular basis; to enable users to quickly examine their worker logs and understand memory issues.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RuntimeMemory
Return a singleton RuntimeMemory object.long
SeeRuntime.maxMemory()
.void
read
(RuntimeMemory.Sample buf) Read last collected samples.void
Read last collected samples.
-
Method Details
-
getInstance
Return a singleton RuntimeMemory object.- Returns:
- the RuntimeMemory singleton
-
read
Read last collected samples. Triggers a new snapshot if the last snapshot is older thancacheInterval
.- Parameters:
buf
- a user provided buffer object to store the samples.
-
readOnly
Read last collected samples.- Parameters:
buf
- a user provided buffer object to store the samples.
-
maxMemory
public long maxMemory()SeeRuntime.maxMemory()
.
-