Troubleshooting the removal of files that are no longer needed

WebSphere® Application Server uses various temporary directories to store state information during operation. Some files can accumulate during normal operation, especially if operations are interrupted or abandoned. Typically, it is safe to remove these files and folders when no application server or tool JVMs are running in the full profile.

About WebSphere Application Server temporary folders

The following list names the usual temporary directories and their contents.
  • <profile>/temp:

    This directory is the general-purpose temporary directory for assorted processes. It can be cleared once there are no JVMs running in that profile.

  • <profile>/config/temp:

    This directory is used primarily for file transfers when you are updated applications or configuration information. Empty subdirectories can remain after transfers are completed. These subdirectories can be cleared once there are no JVMs running in that profile.

  • <profile>/wstemp

    This directory is used primarily to contain subfolders that represent a workspace session. When functions that access configuration data is invoked from the console or scripting, a workspace session is created and the relevant configuration files are copied into that directory. Should the file or files be updated, the session facilitates atomic updates and conflict management across multiple sessions.

    Sessions are cleaned up one ConfigService save() or discard() is called on the session, or once workspace.remove() is called. If neither is done, they can persist and consume disk space, and in some cases memory can be consumed.

    Sessions persist across server restarts. If a user that has made configuration updates accidentally or intentionally gets logged out before you save or discard, the session can be recovered on a subsequent login and the work can be resumed.

    Cleaning up these folders when no JVMs are running is safe, however you will lose the pending updates from any interrupted sessions.

    If a script or other code call functions that access or manipulate configuration files, but then not call, save, or discard upon completion, a workspace directory remains. Such an instance can cause the wstemp directory to grow rapidly if it is being run frequently.

    The following list illustrated items within the contents of the wstemp directory that can be used to help identify the causes of unexpected file growth. These are not APIs or SPIs.
    1. The name of the directory under wstemp.
      • anonymousXXXXXXXXX where XXXXXXXXX is the time in milliseconds. This directory is created by creating a session.
      • ScriptXXXXXXXXXX where XXXXXXXXXX is an alphanumeric key. This directory is created by wsadmin.
      • other: the name of the workspace can be specified programmatically as Session (name, false).
    2. wstemp/<folder>/workspace/.workspace_: This file contains the call stack of the server-side code that created the workspace.

      If it is available, the call stack of the client-side code from a different JVM is also stored in this file.