Link to home
Start Free TrialLog in
Avatar of learningunix
learningunix

asked on

memory

I have a C++ applicaion that is running as a daemon. The way I check the memory consumption is

top -p <pid>
I have noticed that "Reident Memory" is continously increasing on certain operation. Is there any easy to find out memory leak on linux.

If Valgrind is the way to go, how can I run it against the c++ daemon
 
Avatar of learningunix
learningunix

ASKER

When I run the command:

valgrind --tool=memcheck --leak-check=yes myDaemon_g --log-file=valgrind.log

it fails with

error while loading shared libraries: libxyz.so: cannot open shared object file: No such file or directory

what does this mean usually? do I have to set LD_LIBRARY_PATH? is there any easy way to find where this libxyz.so resides on the system
Avatar of jkr
Yes, that means that the lib in question is either not present or your LD_LIBRARY_PATH environment variable does not contain the directory it resides in. The simplest way to locate that lib would be to run

find / -name libxyz.so -print

or

find / -name "libxyz*" -print
find / this will take forever. I thought there was some other easy way to do it
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thx