|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.efs.Utils
public final class Utils
Utility routines, eg for memory and threading.
| Nested Class Summary | |
|---|---|
static class |
Utils.SimpleLRUMapAutoSizeForHitRate<K,V>
Simplified map with fixed capacity that discards excess items in LRU (Least Recently Used) order to meet a hit/miss ratio goal. |
| Method Summary | |
|---|---|
static boolean |
isMemoryStressed()
Returns true if the memory system may be under stress, eg not enough free. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final boolean isMemoryStressed()
This is likely to be at best stochastic, ie more likely to return true under severe memory stress, and less likely to return true when not under significant memory stress.
This checks the clearing of a SoftReference as one measure of memory stress:
TODO: make use of MemoryPoolMXBean (etc) facilities for more robust detection.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||