English 中文(简体)
valgrind on server process
原标题:

hi i am new to valgrind. I know how to run valgrind on executable files from command line. But how do you run valgrind on server processes like apache/myqld/traffic server etc ..

I want to run valgrind on traffic server (http://incubator.apache.org/projects/trafficserver.html) to detect some memory leaks taking place in the plugin I have written.

Any suggestions ?

thanks, pigol

问题回答

You have to start the server under Valgrind s control. Simply take the server s normal start command, and prepend it with valgrind.

Valgrind will attach to every process your main "server" process spawns. When each thread or process ends, Valgrind will output its analysis, so I d recommend piping that to a file (not sure if it comes out on stderr or stdout.)

If your usual start command is /usr/local/mysql/bin/mysqld, start the server instead with valgrind /usr/local/mysql/bin/mysqld.

If you usually start the service with a script (like /etc/init.d/mysql start) you ll probably need to look inside the script for the actual command the script executes, and run that instead of the script.

Don t forget to pass the --leak-check=full option to valgrind to get the memory leak report.





相关问题
Why does valgrind say basic SDL program is leaking memory?

Here is the SDL program: #include <SDL/SDL.h> int main(int argc, char** argv){ SDL_Init(SDL_INIT_VIDEO); SDL_Surface* screen = SDL_SetVideoMode(640, 480, 16, SDL_HWSURFACE); SDL_Quit(); ...

Debugging a core produced by valgrind

Valgrind produced a vgcore.NNNN file -- how do I debug the core using GDB? Do I need to use the original executable and supply the core, or is there some other way to do it? Using valgrind as the ...

Locate bad memory access on Solaris

On Linux, FreeBSD and other systems I have valgrind for checking for memory errors like invalid reads and similar. I really love valgrind. Now I have to test code on Solaris/OpenSolaris and can t find ...

Valgrind memcheck programmatic enable

I don t suppose there is a way to programmatically enable/disable Valgrind memcheck the way you can with callgrind? (Start/stop instrumentation). It s painfully, unusably slow (which is okay if the ...

kcachegrind for RHEL 5.1

I m about to perform profiling to application. I have vagrind, but kcachegrind is not installed. Tryied to compile without success. Where it can be obtained from for RHEL 5.1?

热门标签