This is an automated email from the ASF dual-hosted git repository. skygo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans-native-launchers.git
commit 82770818e47de325b39b5eabfd138f156d3e8e29 Author: Laszlo Kishalmi <laszlo.kisha...@gmail.com> AuthorDate: Mon Dec 3 11:31:18 2018 -0800 [NETBEANS-1605] Removed NetBeans max HeapSize heuristics. (#1007) * [NETBEANS-1605] Removed NetBeans max HeapSize heuristics. * Removed areWeOn32bits(), min heap size and the reference of deprecated CMS GC. --- nblauncher.cpp | 44 -------------------------------------------- nblauncher.h | 2 -- 2 files changed, 46 deletions(-) diff --git a/nblauncher.cpp b/nblauncher.cpp index 37adb70..dda65af 100644 --- a/nblauncher.cpp +++ b/nblauncher.cpp @@ -89,7 +89,6 @@ int NbLauncher::start(int argc, char *argv[]) { parseConfigFile((userDir + "\\etc\\" + getAppName() + ".conf").c_str()); userDir = oldUserDir; - adjustHeapAndPermGenSize(); addExtraClusters(); string nbexecPath; SetDllDirectory(baseDir.c_str()); @@ -489,49 +488,6 @@ bool NbLauncher::parseConfigFile(const char* path) { typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); -bool NbLauncher::areWeOn32bits() { - // find out if we are on 32-bit Windows - SYSTEM_INFO siSysInfo; - PGNSI pGNSI; - pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), - "GetNativeSystemInfo"); - if (NULL != pGNSI) - pGNSI(&siSysInfo); - else - GetSystemInfo(&siSysInfo); - logMsg("NbLauncher::areWeOn32bits returns (0=false, 1=true)? %i", ((siSysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) || - (strstr(NBEXEC_FILE_PATH, "64") == NULL))); - return ((siSysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) || - (strstr(NBEXEC_FILE_PATH, "64") == NULL)); -} - -// Search if -Xmx and -XX:MaxPermSize are specified in existing arguments -// If it isn't compute default values based on 32/64-bits and available RAM -void NbLauncher::adjustHeapAndPermGenSize() { - if (nbOptions.find("-J-Xmx") == string::npos) { - int maxheap; - if (areWeOn32bits()) - maxheap = 512; - else - maxheap = 1024; - // find how much memory we have and add -Xmx as 1/5 of the memory - MEMORYSTATUSEX ms; - ms.dwLength = sizeof (ms); - GlobalMemoryStatusEx(&ms); - int memory = (int)((ms.ullTotalPhys / 1024 / 1024) / 5); - if (memory < 96) { - memory = 96; - } - else if (memory > maxheap) { - memory = maxheap; - } - char tmp[32]; - snprintf(tmp, 32, " -J-Xmx%dm", memory); - logMsg("Memory settings: -J-Xmx%dm", memory); - nbOptions += tmp; - } -} - const char * NbLauncher::getAppName() { return "netbeans"; } diff --git a/nblauncher.h b/nblauncher.h index 591e65f..469a21f 100644 --- a/nblauncher.h +++ b/nblauncher.h @@ -63,8 +63,6 @@ public: protected: virtual bool initBaseNames(); virtual void addSpecificOptions(CmdArgs &args); - virtual bool areWeOn32bits(); - virtual void adjustHeapAndPermGenSize(); virtual bool findUserDir(const char *str); virtual bool findCacheDir(const char *str); virtual const char * getAppName(); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists