Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File handle limit?



Thanks Pratik! I had success using a modified version of Greg's Suite/ P, but not having to involve JNI is probably a win here.

Jacob
On Aug 22, 2008, at 4:45 PM, Pratik Solanki wrote:

Jacob,

In order to use more than 10240 file descriptors in Java, you'll need
to pass '-XX:-MaxFDLimit' to the VM.

The reason is that Java tries to "up" its max file descriptor limit in
normal usage to OPEN_MAX using setrlimit. OPEN_MAX is set to 10240 in
the include files and this hurts you when you are explicitly using a
sysctl to bump up the limit in the kernel. By passing '-XX:-
MaxFDLimit', you'll tell the VM to not call setrlimit and hence it
should be able to access more file descriptors.

Pratik

On Aug 21, 2008, at 4:38 PM, Jacob Scott wrote:

Hi Greg,

I've made changes to the kern.* options by creating a /etc/
sysctl.conf:

administrators-mac-pro:bin jhscott$ cat /etc/sysctl.conf
kern.maxfiles=512000
kern.maxfilesperproc=256000

I don't necessarily need 256k file handles, but I do need more than
10k (I have unit tests simulating normal behavior which are dying).
I'm running a search server that is indexing a large corpus of
files; and to guarantee fresh results, am often reopening files. I
can't necessarily close old descriptors with any haste, because they
may be servicing existing searches.

I'll be taking a look at the man pages you suggested as well as your
Suite/P software, but on linux this is as easy as ulimit -n <large>;
java Application

Thanks very much,

Jacob

On Aug 21, 2008, at 4:25 PM, Greg Guerin wrote:

Jacob Scott wrote:

I'd like to run java on OSX Leopard with a high file handle limit.
My shell is configured correctly:

administrators-mac-pro:~ jhscott$ ulimit -a

The plain 'ulimit' bash command only affects the soft-limit. There
is also a hard-limit for each limitable resource, and the soft-limit
cannot go higher than that value. The hard-limit is not necessarily
the same as the MAX value noted by Bill Wagner, though the hard- limit
is often initially the same as that MAX value.


Read 'man setrlimit'.  Also see the -H option to bash's 'ulimit'
builtin.


Finally, there is a system-wide limit on open files, determined by
the "kern.maxfiles" sysctl value. The related value
"kern.maxfilesperproc" determines the initial per-process hard- limit.


See 'man 1 sysctl' and 'man 3 sysctl', and search for maxfiles.


I wonder what you're doing that needs a quarter-million fd's open all
at the same time. Please describe what problem you're trying to
solve by throwing that many fd's at it.


-- GG

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: File handle limit? (From: Greg Guerin <email@hidden>)
 >Re: File handle limit? (From: Jacob Scott <email@hidden>)
 >Re: File handle limit? (From: Pratik Solanki <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.