diff options
author | madmaxoft <github@xoft.cz> | 2013-08-25 17:06:51 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-08-25 17:06:51 +0200 |
commit | 83811b69292bff0ef4b24087a4a4d3e523b0076a (patch) | |
tree | 50bf797896f5df82af4cfcd642759d005c598044 /source/LeakFinder.cpp | |
parent | Projectile entities get saved into MCA files (diff) | |
parent | Reduced LeakFinder's stack buffers to half. (diff) | |
download | cuberite-83811b69292bff0ef4b24087a4a4d3e523b0076a.tar cuberite-83811b69292bff0ef4b24087a4a4d3e523b0076a.tar.gz cuberite-83811b69292bff0ef4b24087a4a4d3e523b0076a.tar.bz2 cuberite-83811b69292bff0ef4b24087a4a4d3e523b0076a.tar.lz cuberite-83811b69292bff0ef4b24087a4a4d3e523b0076a.tar.xz cuberite-83811b69292bff0ef4b24087a4a4d3e523b0076a.tar.zst cuberite-83811b69292bff0ef4b24087a4a4d3e523b0076a.zip |
Diffstat (limited to 'source/LeakFinder.cpp')
-rw-r--r-- | source/LeakFinder.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/LeakFinder.cpp b/source/LeakFinder.cpp index 3242bba04..272e313a0 100644 --- a/source/LeakFinder.cpp +++ b/source/LeakFinder.cpp @@ -116,12 +116,15 @@ /* _X: MSVC 2012 (MSC 1700) seems to use a different allocation scheme for STL containers, * allocating lots of small objects and running out of memory very soon * Thus for MSVC 2012 we cut the callstack buffer length in half +* +* _X 2013_08_25: The callstack tracking gets worse even for MSVC 2008, a single lua_state eats 50 MiB of RAM +* Therefore I decided to further reduce the buffers from 0x2000 to 0x1000 */ // Controlling the callstack depth #if (_MSC_VER < 1700) - #define MAX_CALLSTACK_LEN_BUF 0x2000 -#else #define MAX_CALLSTACK_LEN_BUF 0x1000 +#else + #define MAX_CALLSTACK_LEN_BUF 0x0800 #endif @@ -942,10 +945,10 @@ static int MyAllocHook(int nAllocType, void *pvData, g_CurrentMemUsage += nSize ; g_pCRTTable->Insert(lRequest, c, nSize); - if (g_CurrentMemUsage > 1073741824) //This is 1 gb = 1024 * 1024* 1024. + if (g_CurrentMemUsage > 1536 * 1024* 1024) { printf("******************************************\n"); - printf("** Server reached 1 GiB memory usage, **\n"); + printf("** Server reached 1.5 GiB memory usage, **\n"); printf("** something is probably wrong. **\n"); printf("** Writing memory dump into memdump.xml **\n"); printf("******************************************\n"); |