Too many open files?

100 views
Skip to first unread message

SpinningCompass

unread,
Sep 13, 2009, 9:50:53 PM9/13/09
to buzhug
I get "Too many open files" if I open several (20+) databases under
Windows, but no such error under Linux. I've had this error before -
when I had accidentally created a recursive database relationship -
but that's not the case here.

I could rewrite my code to open fewer databases, or to use IDs instead
of relationships - i.e. second_table[first_record.id] instead of
second_table.first_record - but I would like to understand what I'm
doing wrong and whether it is in fact a Windows-specific problem.

Any ideas?

Thanks for your wonderful database,

-Hugo R.

Pierre Quentel

unread,
Sep 14, 2009, 8:10:34 AM9/14/09
to buzhug
Hi,

buzhug opens a file for each field (including one for record ids and
one for version number) + 4 for internal uses. If you open 20
databases with many fields in each it's possible that the limit
defined for your OS is reached

This was discussed in threads a few months ago :
http://groups.google.com/group/buzhug/browse_thread/thread/21ebdfd2cfa3fe51#
http://groups.google.com/group/buzhug/browse_thread/thread/8bb8637233660e2a#

The maximum number of open files can be defined in Linux (see the
threads above) but I don't know if it's possible with Windows

Best regards,
Pierre

Jim Eggleston

unread,
Sep 15, 2009, 7:57:57 AM9/15/09
to buz...@googlegroups.com
I am not sure if this will work, but you could try changing the "files" setting in c:\windows\system32\config.nt. On my XP box it is set to:

files=40

It certainly dosn't sound like 40 open files would be sufficient for your script to run. Changing this setting would be easy enough on your own machine, but would be inconvenient if you wanted other (non-technical) people to use your script on their own machines.

Cheers,
Jim




2009/9/14 Pierre Quentel <quentel...@wanadoo.fr>

Jim Eggleston

unread,
Oct 2, 2009, 8:10:17 PM10/2/09
to buz...@googlegroups.com
I have time to look into this a little further. The information in my previous post only applies to the 16 bit sub-system (DOS.)

This article indicates that using Java (Sun not MS) the maximum number of files that can be opened in Windows using the C library API is around 2035:
http://osdir.com/ml/jakarta.lucene.user/2003-08/msg00020.html

And someone states in this python thread that the maximum number of open files in Windows XP is 512 (509 in reality, because you will always have stdin, stdout and stderr):
http://bytes.com/topic/python/answers/766892-too-many-open-files

I guess you will have to work with in these limits.

Cheers,
Jim




2009/9/15 Jim Eggleston <jim.eg...@gmail.com>
Reply all
Reply to author
Forward
0 new messages