public long getApproximateFreeMemory ( int deviceId ) { val externalAllocations = getTotalMemory ( deviceId ) - getFreeMemory ( deviceId ) ; val active = getActiveMemory ( deviceId ) ; val free = getTotalMemory ( deviceId ) - ( active + externalAllocations ) ; return free ; }
This method returns approximate free memory on specified device