From 486b2e378e135235b132f675bf5034fda8eb01f2 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Thu, 16 Jun 2016 20:55:17 -0700 Subject: [PATCH] since SG was noticing a crash in some instances (using mods), i'll go back to using 75% available ram, which is still more than SOE ever allotted --- .../application/SwgClient/src/win32/WinMain.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/game/client/application/SwgClient/src/win32/WinMain.cpp b/src/game/client/application/SwgClient/src/win32/WinMain.cpp index b0a5e7281..b29dd0cba 100644 --- a/src/game/client/application/SwgClient/src/win32/WinMain.cpp +++ b/src/game/client/application/SwgClient/src/win32/WinMain.cpp @@ -49,14 +49,19 @@ static bool SetUserSelectedMemoryManagerTarget() static void SetDefaultMemoryManagerTargetSize() { - // just use all available up to 2048gb, else ALL available, since we're 99% guranteed to be on a modern machine + // we use 75% of the available ram, up to 1536mb in the case of 2gb (32 bit without PAE limit) MEMORYSTATUSEX memoryStatus = { sizeof memoryStatus }; GlobalMemoryStatusEx(&memoryStatus); int ramMB = (memoryStatus.ullTotalPhys / 1048576); - // without PAE enabled 2048 is the max we can do - if (ramMB >= 2048){ - ramMB = 2048; + // without PAE enabled 2048 is the max we can do, but SWG crashes if we give it all the RAM sometimes + if (ramMB >= 2048) + { + ramMB = 1536; + } + else + { + ramMB = (ramMB * .75); } MemoryManager::setLimit(ramMB, false, false);