LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 09: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, 10:20 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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, 01: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, 02: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, 12: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, 12:51 AM   #6
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
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



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 01: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 08:19 PM
How do I open appleworks files (.cwk) in open office? mkpovak Linux - Desktop 1 08-08-2006 04:03 AM
how to open files from a network server from open office or any apps reycapoy Linux - Software 4 01-26-2006 07:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:50 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
Open Source Consulting | Domain Registration