Windows
By default, Windows does not ship with a tool to debug this type of
problem. However, there is a freeware tool called Process Explorer that
you can download from the following URL:http://www.sysinternals.com/ntw2k/freeware/procexp.shtml
This tool identifies the open handles associated with the Java™ process
and determines which handles are being opened, but not closed. These
handles result in the Too many open files error message.
It is important that you change the Refresh Rate. Select View > Update
Speed, and change it to 5 seconds.

There is also a utility called Handle that you can download from the
following URL:
http://www.sysinternals.com/ntw2k/freeware/handle.shtml
This tool is a command line version of Process Explorer. The URL above
contains the usage instructions.
AIX
To determine if the number of open files are growing over a period of
time, issue lsof to report the open files against a PID on a
periodic basis. For example:
lsof -p (PID of process) -r (interval in
seconds, 1800 for 30 minutes) > lsof.out
This output does not give the actual file names to which the handles are
open. It provides only the name of the file system (directory) in which
they are contained. The lsof command indicates if the open file is
associated with an open socket or a file. When it references a file, it
identifies the file system and the inode, not the file name.
Run the following command to determine the file name:
# df -kP filesystem_from_lsof | awk '{print $6}' | tail -1
note the filesystem name
# find filesystem_name -inum inode_from_lsof -print
shows the actual file name
To increase the number, change or add the
nofiles=XXXXX parameter in the /etc/security/limits
file, or by using the command: huser nofiles=XXXXX
user_id
You can also use svmon:
# svmon -P java_pid -m | grep pers
(this opens files in the format: filesystem_device:inode)
Use the same procedure as above for finding the actual file name.
Linux 2.1.72 and above on Intel-based systems
To determine if the number of open files are growing over a period of
time, issue lsof to report the open files against a PID on a
periodic basis. For example:
lsof -p (PID of process) -r (interval in seconds, 1800 for 30 minutes)
> lsof.out
The output will provide you with all of the open files for the specified
processID. You will be able to determine which files are opened and which
files are growing over time.
SOLARIS
Run the following commands to monitor open file (socket) descriptors on
Solaris:
- ulimit -a > ulimit.out
- /usr/proc/bin/pfiles [PID of process that has too many
open files] > pfiles.out
- lsof -p [PID of process that has too many open
files] > lsof.out
- To determine if the number of open files is growing over a period of
time, issue lsof to report the open files against a PID on a
periodic basis. For example:
lsof -p (PID of process) -r (interval in seconds, 1800 for 30
minutes) > lsof.out
Sample output of lsof.out:
COMMAND PID NODE NAME
java 6116 2640007 /WebSphere/AppServer/eAAS/debug.log
java 6116 2640007 /WebSphere/AppServer/eAAS/debug.log
java 6116 2640007 /WebSphere/AppServer/eAAS/debug.log
java 6116 2640007 /WebSphere/AppServer/eAAS/debug.log
java 6116 2640007 /WebSphere/AppServer/eAAS/debug.log
java 6116 2640007 /WebSphere/AppServer/eAAS/debug.log
java 6116 2640007 /WebSphere/AppServer/eAAS/debug.log
java 6116 2640007 /WebSphere/AppServer/eAAS/debug.log
java 6116 2640007
/WebSphere/AppServer/eAAS/debug.log
After analyzing the above collected data, if you need to increase the
limit for number of open file descriptors, run the following command:
ulimit -n nnnn (Where is nnnn is the desired
number of open files)
Other lsof information
If lsof is not installed on your system, you can go to the URL below to
get a copy: http://www-1.ibm.com/support/docview.wss?uid=swg21115219
lsof is available for the following operating systems:
- AIX 4.3.[23], 5L, and 5.1
- HP-UX 11.00 and 11.11
- Linux® 2.1.72 and above for Intel-based systems
- Solaris 2.6, 7, 8, and 9
|