• Post Reply Bookmark Topic Watch Topic
  • New Topic

max file handles  RSS feed

 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been trying to determine what happens if MAX_OPEN_FILE_HANDLES for the underlying OS is exceeded. I set the launch-loop harness to the Solaris setting and ran it on proprietary windows. (do not have access to a solaris machine) It looks like the filename is created in the directory listing, but nothing is written to the file.

Reading the sources for the JVM is beyond my skills at this point. This is a critical design point (prototyping can continue while a definitive answer is obtained) but I am there now and really need the help of a master on this, try / catch does not seem to throw an io exception.

I can do testing to destruction now, but want to design the program to be reliable in the hands of users who do not want to delve into cs.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37469
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nicholas,
I think you might have more luck in the UNIX forum with this one. I'll move it there for you. Someone can always move it back to testing.
 
Tim Holloway
Saloon Keeper
Posts: 18793
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the JVM is unable to establish or maintain the proper environment for file I/O, an exception should be thrown regardless of the OS or the underlying reason. That's what Exceptions are for. If you have a situation where this doesn't happen, I consider it a bug in the JVM.

If the exception gets thrown but your application code catches it and throws it away, that's your problem, but a exception should be thrown. You shouldn't be able to open a file and then silently lose I/O on it.

It's possible on some architectures that a file might be created without using a file handle, so that part would succeed. However once you opened it and it began to write at the OS level (which might not actually occur until you flushed it), if the write doesn't return from the OS correctly, there's a problem with the JVM.

Of course, if you experiment and come up with some "gotcha"s for your platform of choice, we'd love to her about them. Just because the basic rules for Java I/O say thus-and-so doesn't mean that there aren't ways for things to happen that can result in major programming annoyances, so it's always good to be able to take advantage of the experiences of others.
 
Darrin Cartwright
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Nicholas,

On Linux, I get an "IOException: Too many open Files" when the file limit is exceeded. I would expect similar functionality on Solaris.

Hope that helps,

Darrin
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Holloway:
...as posted...

That's what I was thinking - and wanted to get at least somebody else who thought that is what should happen. My design of test harness will probe for {as you put into words}

I have determined already that we need to look at what happens if flush() is not called explicitly by code: It may, emphasise may, be an area for discovery.

If x is provided for in the manual, and we attempt to discuss y ~ our discussion will be thwarted - we are fixing to ask y....

I had a indivdual from (retailer of boxes) clearly criticise the robustness of commercially popular os, along the lines of this discussion.

He used to do accounting work for (governmental agency), his facial and wording expression STRONGLY suggests that testing is appropriate.

I am still working on preening out placeholder code, previously reported faiures should be discounted to maybe status.
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Darrin Cartwright:
Howdy Nicholas,

On Linux, I get an "IOException: Too many open Files" when the file limit is exceeded. I would expect similar functionality on Solaris.

Hope that helps,

Darrin


It does, most definitely. I will sleep better tonight already - many catches already in code, liberally placed at key control points in execution path...If I can expect reasonable behaviour on Solaris - which Linus's kernel is definitely close enough, I can sleep better tonight already on your advice.

 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Holloway:
..... Of course, if you experiment and come up with some "gotcha"s for your platform of choice, we'd love to her about them......


Okay,...

!

Winnie's sittin there at the house, hung...

I mean HUNG pulling reset low using the button on the front of the box has no effect. Cannot even get a keyboard.

This is the second time this has happened in a few years.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!