Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

memory

Posted on 2011-03-18
5
Medium Priority
?
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

636 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