From 55ff2558d7a88cba8ba9c1af9c4c26831aaadb82 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 23 Mar 2013 19:04:39 +0000 Subject: Added auto-kill-with-dump to LeakFinder if the allocated memory grows over 1 GiB. Only works on Windows and only present in Debug mode. Produces memdump.xml for analysis. http://forum.mc-server.org/showthread.php?tid=826&pid=6948#pid6948 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1302 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Server.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/Server.cpp') diff --git a/source/Server.cpp b/source/Server.cpp index 24d999b31..ce631f754 100644 --- a/source/Server.cpp +++ b/source/Server.cpp @@ -452,6 +452,14 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd) DumpUsedMemory(&Output); return; } + + if (split[0].compare("killmem") == 0) + { + while (true) + { + new char[100 * 1024 * 1024]; // Allocate and leak 100 MiB in a loop -> fill memory and kill MCS + } + } #endif if (cPluginManager::Get()->ExecuteConsoleCommand(split)) -- cgit v1.2.3