public static Datum sampleSystemNow ( final boolean medium , final boolean large ) { Datum d = generateCurrentSample ( ) ; if ( d == null ) return null ; historyS . addLast ( d ) ; if ( historyS . size ( ) > historySize ) historyS . removeFirst ( ) ; if ( medium ) { historyM . addLast ( d ) ; if ( historyM . size ( ) > historySize ) historyM . removeFirst ( ) ; } if ( large ) { historyL . addLast ( d ) ; if ( historyL . size ( ) > historySize ) historyL . removeFirst ( ) ; } return d ; }
Synchronously collect memory stats .