From 9934f1a968e69ad0837d29cccd9026074cd0ad97 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 15 Sep 2016 16:49:13 +0300 Subject: [PATCH] Fix for '23343: [CEA 1949] On windows, max_memory too big compared to the memory of the computer' issue. --- src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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; -- 2.39.2