Solved

memory

Posted on 2011-03-18
5
210 Views
Last Modified: 2012-05-11
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
 
0
Comment
Question by:learningunix
  • 3
  • 2
5 Comments
 

Author Comment

by:learningunix
ID: 35167526
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
0
 
LVL 86

Expert Comment

by:jkr
ID: 35167657
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
0
 

Author Comment

by:learningunix
ID: 35167974
find / this will take forever. I thought there was some other easy way to do it
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 35168083
Yes, that will take a while, yet it is the safest method. You could try limiting the area to search to '/usr' to save time.
0
 

Author Closing Comment

by:learningunix
ID: 35227110
thx
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now