Technical Blog Post
Abstract
The WebSphere Application Server <dump directory> location is now recommended to be setup using our Dump Agent, but can still be setup also using legacy Environment Variables, the ladder is subject to being deprecated in future product releases.
Body
1.). Using the Dump Agent to specify a directory for all dump types or for different individual dump types:
The current preferred mechanism to control dump output file location is now using our dump agent in the form of -Xdump:directory as documented below.
-Xdump:
https://www.ibm.com/docs/sl/sdk-java-technology/8?topic=options-xdump
-Xdump:directory=<path> Specifies a <directory> for ALL dump types to be written to. This directory path is prefixed to the path of all non-absolute dump file names, including the file names for the default dump agents.
e. g.
-Xdump:directory=/some/directory
If you may need to further control or specify <directories> for DIFFerent dump types such as javacores, heapdumps, snapdumps, coredumps, then you would not just change the directory as above for all dump types, but instead you would have to change the defaults:file option, which is both the directory and the file name.
e. g. 's
-Xdump:java:defaults:file=/some/directory/javacore.%Y%m%d.%H%M%S.%pid.%seq.txt
-Xdump:system:defaults:file=/some/directory/core.%Y%m%d.%H%M%S.%pid.%seq.dmp
-Xdump:heap:defaults:file=/some/directory/heapdump.%Y%m%d.%H%M%S.%pid.%seq.phd
-Xdump:snap:defaults:file=/some/directory/Snap.%Y%m%d.%H%M%S.%pid.%seq.trc
-Xdump:jit:defaults:file=/some/directory/jitdump.%Y%m%d.%H%M%S.%pid.%seq.dmp
2.). Using Environment Variables:
https://www.ibm.com/docs/en/sdk-java-technology/8?topic=reference-environment-variables
“The preferred mechanism for controlling the production of […] dumps is by using the -Xdump:[…] option”:
The legacy environment variables in this TechNote “are preserved and can still be used”; however, we expect they will be deprecated just like IBM_JAVA_OPTIONS was deprecated and will be removed in a future release.
The WebSphere Application Server (WAS) JVM checks each of the following locations for existence and write-permission, and stores the Javadump, Heapdump, or System Coredump, in the first one available:
- The location specified by the IBM_JAVACOREDIR,IBM_HEAPDUMPDIR and IBM_COREDIR environment variables if set (_CEE_DMPTARG on z/OS).
- The current working directory of the JVM processes or $WAS_HOME/profiles/<ProfileName> dir.
- The location specified by the TMPDIR environment variable, if set.
- The /tmp directory or, on Microsoft Windows only, the location specified by the TEMP environment variable, if set.
- Windows only: If the javadump cannot be stored in any of the above, it is put to STDERR.
Environment Variables to be set for Dump Directory Location:
IBM_JAVACOREDIR
IBM_HEAPDUMPDIR
IBM_COREDIR
TMPDIR
To set these variables for each individual server in the Integrated Solutions Console
- Open the Administrative Console.
- Select Servers > (Expand Server Types) > WebSphere application servers > server_name > (Expand Java and Process Management) > Process Definition > Environment Entries > New.
- Add entries to the Name/Value pairs (from above Environment Variables).
- Click OK.
- Save changes, make sure node is synchronized, and restart the Application Server in the console.
To set these environment variables in a Script
or
Edit <WASHome>/profiles/profile name/bin/startServer.sh and add the lines below:
IBM_JAVACOREDIR=<directory>
export IBM_JAVACOREDIR
IBM_HEAPDUMPDIR=<directory>
export IBM_HEAPDUMPDIR
IBM_COREDIR=<directory>
export IBM_COREDIR
TMPDIR=<directory>
export TMPDIR
Note: you must have enough free disk space for the dump file to be written correctly to the file system, so directory space or ulimits need to be set accordingly.
For example: on AIX, Linux, or Unix, you can set ulimits for Core and File
ulimit -c unlimited
ulimit -f unlimited
If you have limited resources, then you can set whatever values work best for your environment given available disk space and installed physical memory.
UID
ibm11081389