]> SALOME platform Git repositories - plugins/ghs3dplugin.git/commitdiff
Salome HOME
Fix for '23343: [CEA 1949] On windows, max_memory too big compared to the memory... V8_1_BR cbr/crowdin_V8_1_BR V8_1_0 V8_1_0rc1 V8_1_0rc2
authorrnv <rnv@opencascade.com>
Thu, 15 Sep 2016 13:49:13 +0000 (16:49 +0300)
committerrnv <rnv@opencascade.com>
Thu, 15 Sep 2016 13:49:13 +0000 (16:49 +0300)
src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx

index 4cbcd0bb94cef304cec0d6b5f60af866722caaba..0e480bc0692807d12fd50712f2d8bd2213be665d 100644 (file)
@@ -872,11 +872,8 @@ long  GHS3DPlugin_Hypothesis::DefaultMaximumMemory()
   statex.dwLength = sizeof (statex);
   long err = GlobalMemoryStatusEx (&statex);
   if (err != 0) {
-    long totMB = 
-      statex.ullTotalPhys / 1024 / 1024 +
-      statex.ullTotalPageFile / 1024 / 1024 +
-      statex.ullTotalVirtual / 1024 / 1024;
-    return ( 0.7 * totMB );
+    double totMB = (double)statex.ullAvailPhys / 1024. / 1024.;
+    return (long)( 0.7 * totMB );
   }
 #endif
   return 1024;