gamecreator Posted July 1, 2014 Share Posted July 1, 2014 Hello. I was just wondering what the community here likes to use for memory leak detection. I ask because last night my program started to crash in a random place that doesn't make any sense and I figured I have a memory leak. I use Windows Visual Studio 2013 so anything that works with that is a bonus. I found a few things like Visual Leak Detector online and a lot of people seem to suggest Valgrind but I thought I'd ask anyway. Thanks! Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted July 1, 2014 Share Posted July 1, 2014 Hi, Valgrind isn't available for windows (which I assume you are using because of visual studio ) Visual Leak Detector is a nice piece of software. Sadly you can't really debug for memory leaks with Leadwerks 3, since the LUA-VM will always allocate and free memory. So when trying to use VLD or similar stuff with LW3, you will end up with 1000+ Memory Leaks found anywhere inside the LW-Lib. See http://www.leadwerks.com/werkspace/topic/9505-tons-of-memory-leaks-in-leadwerks/page__hl__leak for details. Actually I figure the only way of really testing for memory leaks is using System::GetMemoryUsage() where you still have to do a lot of analysing . Or does anyone have a better idea? 1 Quote Link to comment Share on other sites More sharing options...
gamecreator Posted July 7, 2014 Author Share Posted July 7, 2014 Yeah, just figured this out the hard way. Finally got Visual Leak Detector working (didn't report while my program crashed so I had to comment out some lines to make it exit normally) and I got 2308 memory leaks, which I doubt are all mine. So I have a billion lines of debug information which I can't make heads or tails of. What kills me is that this project is pretty simple right now. The problem may well be obvious to some people and very simply wrong once found... but it all looks fine to me right now. I'll try some other suggestions and test my luck. Otherwise I don't know what to do. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted July 7, 2014 Share Posted July 7, 2014 You should go C++ to make a complete game with LE3, and keep Lua for simple stuff only like some level logic as door , interactive stuff; and you'll have all language advantages and benefits. But i agree some 2308 memory leaks is really big, perhaps osme problem on your configuration or project ? How is behaving memory when you play the game ? pretty stable ? Caus even with memory leaks, the garbage collector perhaps do well it's job ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Ma-Shell Posted July 7, 2014 Share Posted July 7, 2014 You should go C++ to make a complete game with LE3, and keep Lua for simple stufrf only like some level logic as door , interactive stuff. C++ is the way to go in LE3 specially if you target better performance and have all language advantages and benefits. Well, Visual Leak Detector is a tool for C++ and memory leaks are C++-only (no problem for LUA) . The problem is, that even in a new LW-C++ project (even if you don't use any LUA-scripts), the LUA-Virtual Machine is started and claims and releases memory. I don't think, there is a way to disable this. Quote Link to comment Share on other sites More sharing options...
Shadoh Posted July 8, 2014 Share Posted July 8, 2014 what always gets me in c++ is accidentally going outside of array bounds, or providing null references (took me a while to figure out what a segfault was).. It'd be awesome if you could disable memory leak detection for certain areas of code like Lua. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.