Memory leaks diagnose
Is there any tool for diagnosing memory leaks, are yot using any?
I performed load test 1000 requests per 5 seconds, this test wa repeated 5 times.
My Wt FastCgi app started at 10MB went up to 240MB.
I have waited for some hours and it is still 240MB.
What might be wrong?
Updated by Wim Dumon almost 9 years ago
- Status changed from New to Feedback
We use valgrind to verify that Wt (or the applications we develop with Wt) has no memory leaks. On a clean shutdown of the Wt application (with fcgi this is done e.g. by shutting down the http server), Wt will invoke the destructor of all application objects, free all other memory it allocated, and you should have no leaks in the valgrind report (some of the dependency libraries may have a small leak, but that should be constant and not grow with the number of sessions, ...).
Looking at the output of top or ps is a flawed way to check if memory is freed or not. Many implementations of malloc() cache memory for later use, so they don't return it to the OS when you call free(). Even without memory leaks, top may report a significant memory use.