Package nz.org.riskscape.engine
Class MemoryMonitoring
java.lang.Object
nz.org.riskscape.engine.MemoryMonitoring
A Gauge
returning a string indicating whether memory usage is within a certain band = a PoC to see whether
we can detect low memory situations reliable
NB - tends to report false low memory situations, as the standard saw tooth behaviour of the jvm's memory use will trip the gauge, even though a GC will reclaim the memory. Hard to know if this matters, but if code just uses this gauge to manage caches, it's probably fine. Maybe see about using the technique in http://www.fasterj.com/articles/gcnotifs.shtml
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionfinal float
final float
final float
final float
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static String
formatBytes
(long numBytes) com.codahale.metrics.Gauge<MemoryMonitoring.Level>
com.codahale.metrics.Gauge<MemoryMonitoring.Level>
-
Field Details
-
warningRatio
public final float warningRatio- See Also:
-
badRatio
public final float badRatio- See Also:
-
postFullGCwarningRatio
public final float postFullGCwarningRatio- See Also:
-
postFullGCbadRatio
public final float postFullGCbadRatio- See Also:
-
-
Constructor Details
-
MemoryMonitoring
public MemoryMonitoring()
-
-
Method Details
-
formatBytes
-
getCurrentHeapFreeLevel
-
getPostFullGCHeapFreeLevel
-