June 17th, 2003, 02:03 PM
C, Linux, memory usage tracking help needed
As I indicated in previous posts, I'm creating a program that continuously runs in a loop. And because each loop can have different memory requirements, it's important that all the allocated memory is freed for the next loop cycle.
Now I've integrated memwatch into my code, which monitors allocations done with malloc and calloc, and records if they go unfreed once the program ends. According to that I have no memory leaks, however watching the memory utilization in 'top' indicates it's demanding a new 176k every cycle (at a point in development that all cycles _should_ only demand the same).
I've heard that 'top' isn't the best tool to use for such monitoring so my question is, is there a tool that more effectively monitors memory in real-time, or should I just ignore what top says and trust memwatch?
Thanks in advance