03-24-2013, 04:59 AM
(03-24-2013, 02:48 AM)xoft Wrote: No, the exe cannot run, says "not a valid Win32 application". I'm running on WinXP, so if you compiled with VS2012, I'm not able to run such a program.
Yeah, VS2012 uses new API that was introduced in windows vista or later.
Quote:Well aren't I good! Smile I think I've written a really useful tool for visualizing the memory usage. It reads a memdump.xml file produced by the "dumpmem" console command, and outputs a list of functions and total memory they and their children allocated, as well as a DOT file for drawing a graph (using GraphViz) representing the hierarchy of memory allocation.
Have a look here: http://mc-server.xoft.cz/img/memdump.svg (you need a decent browser, it's a huge picture in SVG format, 1 MiB in size; scroll to the center to find the actual image data)
And the list (example extract of a 54 KiB text file):
Code:894936 tolua_AllToLua_open
1168855 cPluginManager::AddPlugin
1170151 cPluginManager::LoadPlugin
1170583 cPluginManager::ReloadPluginsNow
1175920 cPlugin_NewLua::Initialize
7846804 cRoot::LoadWorlds
9542448 cChunkMap::cChunkLayer::GetChunk
9558944 cWorld::InitializeSpawn
9558944 cChunkMap::TouchChunk
9558944 cRoot::StartWorlds
9558944 cChunkMap::GetChunk
Now I only need the memory allocation data. And I think I'll add some filtering, having CryptoPP and Lua in that graph is pretty useless.
Oh, that's cool! it looks good to analyze memory usage.
Quote:I'll now write the code to dump memory when memory usage reaches 1 GiB.
oh ok, let me know when I can run some tests