protected void initHostCollectors ( ) { for ( int i = 0 ; i < configuration . getNumberOfGcThreads ( ) ; i ++ ) { ReferenceQueue < BaseDataBuffer > queue = new ReferenceQueue <> ( ) ; UnifiedGarbageCollectorThread uThread = new UnifiedGarbageCollectorThread ( i , queue ) ; // all GC threads should be attached to default device Nd4j . getAffinityManager ( ) . attachThreadToDevice ( uThread , getDeviceId ( ) ) ; queueMap . put ( i , queue ) ; uThread . start ( ) ; collectorsUnified . put ( i , uThread ) ; /* ZeroGarbageCollectorThread zThread = new ZeroGarbageCollectorThread((long) i, shouldStop); zThread.start(); collectorsZero.put((long) i, zThread); */ } }
This method executes preconfigured number of host memory garbage collectors