Package com.illumon.iris.db.v2.utils
Class RuntimeMemory
java.lang.Object
com.illumon.iris.db.v2.utils.RuntimeMemory
public class RuntimeMemory extends Object
Cache memory utilization.
Calling Runtime.getRuntime().getFreeMemory() is expensive; and we may do it a lot when we have automatically computed tables, such as in a byExternal. 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.
-
Method Summary
Modifier and Type Method Description long
freeMemory()
SeeRuntime.freeMemory()
.static RuntimeMemory
getInstance()
Return a singleton RuntimeMemory object.long
totalMemory()
-
Method Details
-
getInstance
Return a singleton RuntimeMemory object.- Returns:
- the RuntimeMemory singleton
-
freeMemory
public long freeMemory()SeeRuntime.freeMemory()
. -
totalMemory
public long totalMemory()
-