LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to check number of opened handles (https://www.linuxquestions.org/questions/linux-general-1/how-to-check-number-of-opened-handles-575037/)

ruj.sabya 08-06-2007 04:52 AM

how to check number of opened handles
 
In windows systems, I can check number of opened handles by a process, by simply enabling "hanles" column in taskmanager.

Is there anything similar(command or GUI) in linux, by which I can check number of opened handles by a process?

Actually I have created an application, and I want to check if any resource is leaking!

wjevans_7d1@yahoo.co 08-06-2007 07:43 AM

Code:

ls /proc/whateverprocessnumberyouwant/fd | wc -l
#                                              ^
#                                              ^
#                                            ell, not one

If it turns out you have a leak, you can even find out what the names of the open files are:
Code:

ls -l /proc/whateverprocessnumberyouwant/fd
Hope this helps.

ruj.sabya 08-06-2007 08:37 AM

Great! Thanks.


All times are GMT -5. The time now is 04:35 AM.