# HG changeset patch # User Chris Cannam # Date 1213027282 0 # Node ID e37e446817202812a0d729c3f7aa5de3da91c070 # Parent c8955c486340d36091bd04b63ae7d56cadd77b81 * Fix failure to take into account near-OOM situations! diff -r c8955c486340 -r e37e44681720 base/StorageAdviser.cpp --- a/base/StorageAdviser.cpp Mon Jun 09 09:41:58 2008 +0000 +++ b/base/StorageAdviser.cpp Mon Jun 09 16:01:22 2008 +0000 @@ -22,7 +22,7 @@ #include -//#define DEBUG_STORAGE_ADVISER 1 +#define DEBUG_STORAGE_ADVISER 1 long StorageAdviser::m_discPlanned = 0; long StorageAdviser::m_memoryPlanned = 0; @@ -85,12 +85,12 @@ int maxmb = maximumSize / 1024 + 1; if (memoryFree == -1) memoryStatus = Unknown; + else if (memoryFree < memoryTotal / 3) memoryStatus = Insufficient; else if (minmb > (memoryFree * 3) / 4) memoryStatus = Insufficient; else if (maxmb > (memoryFree * 3) / 4) memoryStatus = Marginal; else if (minmb > (memoryFree / 3)) memoryStatus = Marginal; else if (memoryTotal == -1 || minmb > (memoryTotal / 10)) memoryStatus = Marginal; - else if (memoryFree < memoryTotal / 4) memoryStatus = Marginal; else memoryStatus = Sufficient; if (discFree == -1) discStatus = Unknown;