b=475595; disable IsLowMemory on Windows CE until we can fix it to be correct/performant; r=dougt
authorVladimir Vukicevic <vladimir@pobox.com>
Wed, 11 Feb 2009 18:26:27 -0800
changeset 24931 213429e61488cdc628d5fb2a7be2883ad87530ae
parent 24930 be1b0898ed40572494416f5e2505b5f9c72cbaba
child 24932 d04183311a19739dfce67f0b0feafe2c1798f09f
child 25101 6758dedadadcf1c6743fa8bbc57830a01e6e8bae
push idunknown
push userunknown
push dateunknown
reviewersdougt
bugs475595
milestone1.9.2a1pre
b=475595; disable IsLowMemory on Windows CE until we can fix it to be correct/performant; r=dougt
xpcom/base/nsMemoryImpl.cpp
--- a/xpcom/base/nsMemoryImpl.cpp
+++ b/xpcom/base/nsMemoryImpl.cpp
@@ -188,19 +188,27 @@ nsMemoryImpl::HeapMinimize(PRBool aImmed
  * unless it's part of an office suite.
  */
 static const int kRequiredMemory = 0x3000000;
 
 NS_IMETHODIMP
 nsMemoryImpl::IsLowMemory(PRBool *result)
 {
 #if defined(WINCE)
+    *result = PR_FALSE;
+    // See bug 475595 -- this is incorrect right now, and causes a big
+    // perf hit since GlobalMemoryStatus has to grab a kernel VM lock
+    // and do a bunch of munging through VM pages to get the data
+    // that's requested.  We call IsLowMemory in some performance
+    // critical code (e.g. during painting), so that's bad.
+#if 0
     MEMORYSTATUS stat;
     GlobalMemoryStatus(&stat);
     *result = ((float)stat.dwAvailPhys / stat.dwTotalPhys) < 0.1;
+#endif
 #elif defined(XP_WIN)
     MEMORYSTATUSEX stat;
     stat.dwLength = sizeof stat;
     GlobalMemoryStatusEx(&stat);
     *result = (stat.ullAvailPageFile < kRequiredMemory) &&
         ((float)stat.ullAvailPageFile / stat.ullTotalPageFile) < 0.1;
 #elif defined(NS_OSSO)
     int fd = open (kHighMark, O_RDONLY);