IBM User Guide for Java V7 on Windows > Troubleshooting and support > Using diagnostic tools > Using the JVMTI > IBM JVMTI extensions - API reference



Removing a shared class cache

You can remove a shared class cache using the DestroySharedCache() API.

The DestroySharedCache() API has the JVMTI Extension Function identifier com.ibm.DestroySharedCache. The identifier is declared as macro COM_IBM_DESTROY_SHARED_CACHE in ibmjvmti.h.

To remove a shared cache, use:

jvmtiError DestroySharedCache(jvmtiEnv *env, const char *cacheDir, const char 
*name, jint persistence, jboolean useCommandLineValues, jint *internalErrorCode);
This extension removes a named shared class cache of a given persistence type, in a given directory. You can specify the cache name, persistence type, and directory by either:

Parameters:

env: A pointer to the JVMTI environment.

cacheDir: When the value of useCommandLineValues is false, specify the absolute path of the directory for the shared class cache. If the value is NULL, the platform-dependent default is used.

cacheName: When the value of useCommandLineValues is false, specify the name of the cache to be removed. If the value is NULL, the platform-dependent default is used.

persistence: When the value of useCommandLineValues is false, specify the type of cache to remove. This parameter must have one of the following values:

  • PERSISTENCE_DEFAULT: The default value for the platform.
  • PERSISTENT.
  • NONPERSISTENT.

useCommandLineValues: Set this value to true when you want to specify the shared class cache name, persistence type, and directory on the command line. Set this value to false when you want to use the cacheDir, persistence and cacheName parameters instead.

internalErrorCode: If not NULL, this value is set to one of the following constants when JVMTI_ERROR_INTERNAL is returned.

  • COM_IBM_DESTROYED_NONE: Set when the function fails to remove any caches.
  • COM_IBM_DESTROY_FAILED_CURRENT_GEN_CACHE: Set when the function fails to remove the existing current generation cache, irrespective of the state of older generation caches.
  • COM_IBM_DESTROY_FAILED_OLDER_GEN_CACHE: Set when the function fails to remove any older generation caches. The current generation cache does not exist or is successfully removed

This value is set to COM_IBM_DESTROYED_ALL_CACHE when JVMTI_ERROR_NONE is returned.

Returns:

JVMTI_ERROR_NONE: Success. No cache exists or all existing caches of all generations are removed.

JVMTI_ERROR_OUT_OF_MEMORY: There is insufficient system memory to process the request.

JVMTI_ERROR_INVALID_ENVIRONMENT: The env parameter is not valid.

JVMTI_ERROR_WRONG_PHASE: The extension has been called outside the JVMTI live phase.

JVMTI_ERROR_NOT_AVAILABLE: The shared classes feature is not enabled in the JVM.

JVMTI_ERROR_ILLEGAL_ARGUMENT: The persistence parameter is not valid.

JVMTI_ERROR_INTERNAL: Failed to remove any existing cache with the given name. See the value of internalErrorCode for more information about the failure.


Parent: IBM JVMTI extensions - API reference








Error 404 - Not Found

Error 404 - Not Found

The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.