From: rnv Date: Thu, 15 Sep 2016 13:49:13 +0000 (+0300) Subject: Fix for '23343: [CEA 1949] On windows, max_memory too big compared to the memory... X-Git-Tag: V8_1_0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cde723fb3f97259023ab08c40ec7a89c46951d0c;p=plugins%2Fghs3dplugin.git Fix for '23343: [CEA 1949] On windows, max_memory too big compared to the memory of the computer' issue. --- diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx index 4cbcd0b..0e480bc 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx @@ -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;