nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java
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);
            */
        }
    }
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);
            */
        }
    }
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
This method executes preconfigured number of host memory garbage collectors