Can anyone point me towards a good tutorial of valgrind, especially for snooping for an extended period of time? My first attempt caused everything (mud, telnet, ftp) to lag out when I tried to do the above, which doesnt' sound normal.
That is quite normal – valgrind is rather CPU intensive, because it has to simulate every instruction with debugging hooks. If you have a CPU quota or a slow computer, it wouldn't be surprising that things would grind (no pun intended…) to a halt for you.
In fact, that's not even so uncommon if you have a computer that's not so slow.. but "a good tutorial of valgrind" would still be nice to find for others too (myself included), any suggestions on what was actually requested? (Other than "google it", that is…)
And to top things off, Valgrind is simply intensive, period. Even on a nice fast CPU with no quotas binding it up. It's also a deep memory hog. So there's not a lot of places that will tolerate its use long-term. I happen to be one of those few who will tolerate it being used. Provided it's not for more than a few hours at a time, and definitely not unattended, but…. yeah. I digress.
I don't know of any decent tutorials on how to use it. The online manual for it isn't the worst I've seen. Would be best to start there.
There isn't really that much to running it, actually. Just start your program with it, perhaps with the memory check flag that it gives you when you shut it down, and then you just wait and watch what it prints.
Well, that's not what his question was, although I agree that might be his problem. :wink: Reading what it tells you is really quite easy as long as you understand the concepts, and I'm not sure that the guides to the concepts are specific to valgrind. If you're not understanding what memory leaks, uninitialized values, etc. are, then the problem is deeper than knowing how to read valgrind's output. If somebody's looking to understand the concepts, I would not recommend reading about valgrind at all, but instead, I'd recommend generic C guides on memory leaks and other common problems.
I'd think some insight into which flags to use with valgrind, and for what, might be almost as useful as guidance in understanding what to do with it's output, but I'll be the first to come forward and confess that some of valgrind's output borders on the cryptic. On the other hand, memory management is clearly not my forte either. :shrug:
The main useful flag in my experience is the one that it tells you about upon termination: –leak-check=full. That tells it to track memory usage more carefully and give more detailed reports on potential and actual memory leaks.