| 2787 | } |
| 2788 | |
| 2789 | void |
| 2790 | AppManager::checkCacheFreeMemoryIsGoodEnough() |
| 2791 | { |
| 2792 | ///Before allocating the memory check that there's enough space to fit in memory |
| 2793 | size_t systemRAMToKeepFree = getSystemTotalRAM() * appPTR->getCurrentSettings()->getUnreachableRamPercent(); |
| 2794 | size_t totalFreeRAM = getAmountFreePhysicalRAM(); |
| 2795 | |
| 2796 | while (totalFreeRAM <= systemRAMToKeepFree) { |
| 2797 | #ifdef NATRON_DEBUG_CACHE |
| 2798 | qDebug() << "Total system free RAM is below the threshold:" << printAsRAM(totalFreeRAM) |
| 2799 | << ", clearing least recently used NodeCache image..."; |
| 2800 | #endif |
| 2801 | if ( !_imp->_nodeCache->evictLRUInMemoryEntry() ) { |
| 2802 | break; |
| 2803 | } |
| 2804 | |
| 2805 | |
| 2806 | totalFreeRAM = getAmountFreePhysicalRAM(); |
| 2807 | } |
| 2808 | } |
| 2809 | |
| 2810 | void |
| 2811 | AppManager::onOCIOConfigPathChanged(const std::string& path) |
no test coverage detected