public synchronized void printAllocationStatisticsForCurrentThread ( ) { ensureThreadExistense ( ) ; Map < String , MemoryWorkspace > map = backingMap . get ( ) ; log . info ( "Workspace statistics: ---------------------------------" ) ; log . info ( "Number of workspaces in current thread: {}" , map . size ( ) ) ; log . info ( "Workspace name: Allocated / external (spilled) / external (pinned)" ) ; for ( String key : map . keySet ( ) ) { long current = ( ( Nd4jWorkspace ) map . get ( key ) ) . getCurrentSize ( ) ; long spilled = ( ( Nd4jWorkspace ) map . get ( key ) ) . getSpilledSize ( ) ; long pinned = ( ( Nd4jWorkspace ) map . get ( key ) ) . getPinnedSize ( ) ; log . info ( String . format ( "%-26s %8s / %8s / %8s (%11d / %11d / %11d)" , ( key + ":" ) , StringUtils . TraditionalBinaryPrefix . long2String ( current , "" , 2 ) , StringUtils . TraditionalBinaryPrefix . long2String ( spilled , "" , 2 ) , StringUtils . TraditionalBinaryPrefix . long2String ( pinned , "" , 2 ) , current , spilled , pinned ) ) ; } }
This method prints out basic statistics for workspaces allocated in current thread