LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-28-2009, 10:34 AM   #1
mark_l
LQ Newbie
 
Registered: May 2009
Posts: 9

Rep: Reputation: 0
Too many open files


In my program, when I try to open a socket, I get the error: Too many open files.

I checked /proc/fs/file-max and this is 50727, and /proc/fs/file-nr is 2134.

What could be the problem?
 
Old 05-28-2009, 11:20 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Try reading about ulimit. It can limit the number of files that a given user can open at a given time, amongst many other things.
 
Old 05-29-2009, 02:24 AM   #3
mark_l
LQ Newbie
 
Registered: May 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Thank you for the tip, but I increased nofiles in /etc/security/limits.conf from 1024 to 4096 and get still the same error.

If I check with ulimit -n, it gives 4096.
 
Old 05-29-2009, 03:50 AM   #4
mark_l
LQ Newbie
 
Registered: May 2009
Posts: 9

Original Poster
Rep: Reputation: 0
I found the problem.

It was a bug in my program. It was creating sockets all the time.
 
Old 06-24-2009, 01:43 AM   #5
janeshb
LQ Newbie
 
Registered: Jun 2009
Posts: 8

Rep: Reputation: 0
Too many open files

How can we find out which type of files are open?? so we can solve or close that socket/files??
 
Old 06-24-2009, 01:51 AM   #6
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 60
Quote:
Originally Posted by janeshb View Post
How can we find out which type of files are open?? so we can solve or close that socket/files??
The lsof command lists open files (as its name suggests ). It has many different options, so just read its manual page.

man lsof
 
  


Reply


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
mmap cache can't open foo.php - Too many open files guarriman Linux - Software 3 12-16-2013 02:03 PM
Cant open .dat files (video) by double clicking though I can open it by openwith.. ravi_npatty Linux - Newbie 17 07-31-2007 09:19 PM
How do I open appleworks files (.cwk) in open office? mkpovak Linux - Desktop 1 08-08-2006 05:03 AM
how to open files from a network server from open office or any apps reycapoy Linux - Software 4 01-26-2006 08:00 PM


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

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