473,670 Members | 2,636 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help: Too many files open

I have a problem of getting the error "too many files open" and would like
to trace my application. However, I have found nothing about how to display
the current number of open files. Does anyone know what code is used to get
the current number of open files?

Also, is there a way to determine the number of open database connections?
Jun 18 '06 #1
7 14615
Tyrone Showers wrote:
I have a problem of getting the error "too many files open" and would like
to trace my application. However, I have found nothing about how to display
the current number of open files. Does anyone know what code is used to get
the current number of open files?

Also, is there a way to determine the number of open database connections?

Most all Java IDE's will let you do debugging at the instruction level.
You may want to use it. To me that this sounds like a coding logic problem.

What OS are you running. JDK version? What file api's are you using?

For Database connections depends on how you are opening the
connection(s). Do you spawn threads that have their own connections?

For me, I need more information!

I did a quick Google for the error you are getting and came up with a
lot of hits. Can not determine what you are doing to indicate a match...

Google .. java too many files open

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
_______________ _______________ _______________ _______________ ______________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Jun 18 '06 #2
I am using JDK 1.4.

The application runs on Linux and Windows.

I do know how to debug. I am using Log4J to help in debugging.

I do know I have a logic problem.

I have searched Google for "Too many files Open" for days for a resolution.

I have all Stream commands surrounded by a try catch with a finally closing
the stream.

This is a massive application and the problem could be anywhere, hence the
reason for tracing. There is really no code to post, because I don't know
where the problem lies.

I would just like to know if Java provides an API to determine your current
level of Open files e.g.,

Files.getCurren tOpenCount();

or

DatabaseConnect ion.getCurrentC onnectionCount( );

And if Java does provide such methods, is there a way to force the JVM to
close these lingering Opens.


"IchBin" <we******@ptd.n et> wrote in message
news:Ps******** ************@pt d.net...
Tyrone Showers wrote:
I have a problem of getting the error "too many files open" and would like to trace my application. However, I have found nothing about how to display the current number of open files. Does anyone know what code is used to get the current number of open files?

Also, is there a way to determine the number of open database connections?
Most all Java IDE's will let you do debugging at the instruction level.
You may want to use it. To me that this sounds like a coding logic

problem.
What OS are you running. JDK version? What file api's are you using?

For Database connections depends on how you are opening the
connection(s). Do you spawn threads that have their own connections?

For me, I need more information!

I did a quick Google for the error you are getting and came up with a
lot of hits. Can not determine what you are doing to indicate a match...

Google .. java too many files open

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
_______________ _______________ _______________ _______________ ______________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)

Jun 18 '06 #3
On Sun, 18 Jun 2006 09:29:32 -0400, Tyrone Showers wrote:
The application runs on Linux and Windows.
[...]
And if Java does provide such methods, is there a way to force the
JVM to close these lingering Opens.


If you are holding references to these objects, the JVM cannot know
they are no longer necessary.

If you are no longer holding references to them, they may eventually
be garbage collected and finalized. Realize though that lack of file
descriptors will not trigger the garbage collector.

On Linux you can use lsof or do "ls -l" in /proc/<pid>/fd to see what
open descriptors any process is holding. You can also use ulimit to
raise the descriptor limit, but that's not a solution to the real
problem.

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
Jun 19 '06 #4

"Tyrone Showers" <ow********@tal iferro.com> wrote in message
news:1z******** ***********@big news8.bellsouth .net...

I would just like to know if Java provides an API to determine your
current
level of Open files e.g.,

Files.getCurren tOpenCount();

or

DatabaseConnect ion.getCurrentC onnectionCount( );

And if Java does provide such methods, is there a way to force the JVM to
close these lingering Opens.


For your second question, the answer is "probably no". How would the JVM
differentiate between an open which is "lingering" and an open which is
"critical to the correct functioning of this application"?

- Oliver

Jun 19 '06 #5
Thanks for your answer.
"Oliver Wong" <ow***@castorte ch.com> wrote in message
news:pDBlg.7083 4$JX1.13708@edt nps82...

"Tyrone Showers" <ow********@tal iferro.com> wrote in message
news:1z******** ***********@big news8.bellsouth .net...

I would just like to know if Java provides an API to determine your
current
level of Open files e.g.,

Files.getCurren tOpenCount();

or

DatabaseConnect ion.getCurrentC onnectionCount( );

And if Java does provide such methods, is there a way to force the JVM to close these lingering Opens.
For your second question, the answer is "probably no". How would the

JVM differentiate between an open which is "lingering" and an open which is
"critical to the correct functioning of this application"?

- Oliver

Jun 20 '06 #6
Thanks for your answer.

"Gordon Beaton" <n.***@for.emai l> wrote in message
news:44******** @news.wineasy.s e...
On Sun, 18 Jun 2006 09:29:32 -0400, Tyrone Showers wrote:
The application runs on Linux and Windows.


[...]
And if Java does provide such methods, is there a way to force the
JVM to close these lingering Opens.


If you are holding references to these objects, the JVM cannot know
they are no longer necessary.

If you are no longer holding references to them, they may eventually
be garbage collected and finalized. Realize though that lack of file
descriptors will not trigger the garbage collector.

On Linux you can use lsof or do "ls -l" in /proc/<pid>/fd to see what
open descriptors any process is holding. You can also use ulimit to
raise the descriptor limit, but that's not a solution to the real
problem.

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e

Jun 20 '06 #7
Tyrone Showers wrote:
I have a problem of getting the error "too many files open" and would
like to trace my application. However, I have found nothing about
how to display the current number of open files.


It looks like there is no simple way to do what you'd like.

I'm assuming that the application does legitimately need to work with a
massive number of files. Is the application spawning threads which are
opening the files? If so, you might want to create a thread pool to do it
instead of spawning an unlimited number of threads.

With a thread pool, you could limit the number of concurrent threads to a
set figure and then have them work on a series of files until the job is
done. For example, you could have 100 threads working through 1000 files
instead of trying to open 1000 files simultaneously in 1000 threads. This
way, you'd avoid two possible limits in the JVM: number of open files and
number of concurrent threads.
Jun 28 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5464
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
2
2557
by: mark | last post by:
I've been working on an Access 2000 database for a couple of weeks now. I took a course in access about a year ago, a crash course, and I learned a ton, but I didn't touch Access for the year since then so I forgot everything I learned : ( So this little project I envisioned has turned out to be much harder than I thought. But I think I'm close with it, so I want to see it through. What I wanted to create is a database that will track my...
3
1460
by: simonharrison | last post by:
Hello everyone. Hopefully someone can point me in the right direction here. I'm wanting to write a script to open microsoft word and adobe pdf documents . Here is a little background: At the company where I work (an inspection firm) all reports of inspections are saved as word files. A particular file may contain many reports named like this; 12345A-F.doc. This file contains six reports. Most inspections also require a technique which is...
31
3132
by: Martin Jørgensen | last post by:
Hi, I've had a introductory C++ course in the spring and haven't programmed in C++ for a couple of months now (but I have been programmed in C since january). So I decided to do my conversion utility in C++, before I forget everything. But it doesn't compile: ------------
0
5558
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
4
1894
by: krishnakant Mane | last post by:
hello, right now I am involved on doing a very important accessibility work. as many people may or may not know that I am a visually handicap person and work a lot on accessibility. the main issue at hand is to create an accessible editor for open office. there are a lot of things remaining on that front. so right now I am trying to find out a temporary work around by creating a simple accessible editor (with wxpython) for viewing and...
12
3002
by: adamurbas | last post by:
ya so im pretty much a newb to this whole python thing... its pretty cool but i just started today and im already having trouble. i started to use a tutorial that i found somewhere and i followed the instructions and couldnt get the correct results. heres the code stuff... temperature=input("what is the temperature of the spam?") if temperature>50: print "the salad is properly cooked." else:
2
4175
by: =?Utf-8?B?SnJ4dHVzZXIx?= | last post by:
I just started using Windows Live OneCare, I had been using Norton, but was unable to fix the problems I was having. I have yet been unsuccessful with OneCare as well. I keep getting the same warning from OneCare, one is for Adware, the other is for a trojan, I clean both, but almost immediatly, I get the same warning? My Windows Defender is also shut down, not by me as I have no idea how to do this(or to turn it back on), but am still...
16
2308
by: Harry Simpson | last post by:
I've been away from ASPNET - I open up a new Web app in VS2008 and go into properties and select to use IIS instead of the personal web server. Then I run in debug mode and it says I have to set the Debug= True in the Web.config which I do. Then try to run it again and it says I must enable integrated security which I do. I then try to run it again and get the HTTP 403 error - " This error (HTTP 403 Forbidden) means that Internet...
0
8468
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8814
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8660
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7415
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4209
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1792
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.