Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-01-2009, 09:48 AM   #1
LQ Newbie
Registered: Jan 2008
Location: india
Distribution: Fedora
Posts: 17

Rep: Reputation: 0
using lsof command

I want to know how lsof command to be used to get the file descriptors leak and memory leak...
I looked in the man pages but i could nt able to predict..

Please help with this...
Thanks in advance..
Old 04-01-2009, 03:58 PM   #2
Senior Member
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (
Posts: 1,900

Rep: Reputation: 69
The problem is that you cannot determine leaks by observations made only from outside the program. lsof will show you all the open files. You may want to find all directories with more than 25 links in them in /proc/*/fd/. But that doesn't mean you will find a leak. By definition the leak occurs when program don't need the resource, but fails to release it; or - by other definition - if it loses proper tracking of that resource. Unfortunately, lsof - being an external entity and not knowing inner workings of a program - cannot reliably determine if a program needs the resource. Imaging watching a HTTP server. It keeps open connections to DB. lsof has no way of knowing whether they are abandoned or just waiting the peak load from clients to be used.
Old 04-02-2009, 02:36 AM   #3
LQ Newbie
Registered: Jan 2008
Location: india
Distribution: Fedora
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks It really helps me to understand the things better..


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
lsof redirect WRXSTi Programming 8 10-02-2006 04:45 PM
What to do when lsof fails.... SpacedCowboy Linux - Security 2 10-29-2005 03:39 PM
Lsof Is Useless?? Philip_38 Linux - Software 3 01-30-2005 10:24 AM
C Library for lsof loki.guz_BR Linux - Security 1 05-19-2004 03:19 PM
lsof: command not found ionian2k Linux - Newbie 1 12-26-2002 09:59 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:06 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration