ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I've written a 3D program using GLUT and wanted to check for memory leaks with Valgrind. However, when I run
valgrind --tool=memcheck myProgram
it takes over 2 minutes for the window to display anything, and then everything runs slowly - whereas when run normally everything is fine.
I appreciate valgrind is doing Wizzardry behind the scenes for me, but is there any way of getting it to do it... a bit faster?
EDIT: the 2 minute figure I quoted is inaccurate, it actually turns out my window manager (xmonad) is playing silly buggers with the window, and only displays the content if you e.g. retile the workspace, or move the window to a different workspace. However, the speed problem still persists...
Hm, yeah, good suggestion, though unfortunately as tuxdev suggested it is a game, so relies on user interaction. Perhaps I could script actions to be carried out automatically and then do the same. Thanks for the suggestions I'll provisionally mark it as solved, but would still welcome any suggestions!
Hm, yeah, good suggestion, though unfortunately as tuxdev suggested it is a game, so relies on user interaction.
Well, you could skip just some of the opengl calls, eg just draw wire-frames.
You might also try using the Boehm GC as a leak detector. I expect that would be faster than both valgrind and drmemory, since it isn't checking for memory corruption. In fact, you may not notice any performance loss at all. Of course, if you actually do have memory corruption it won't help you...