Managing cached object files

To improve build-time performance, Purify caches its instrumented versions of all the libraries and object files that are used by the program. When you rebuild a program, Purify updates only the new or modified files; otherwise it uses the cached versions. (For system libraries such as libc, Purify may not use the cached version if you reinstrument your program on a different machine.)

You can identify an instrumented cache file by its name. It includes _pure_, a Purify version number, and might also include information about the size of the original file, or the name and version number of the operating system.

Purify writes the instrumented files to the original files' directory. If those directories do not have write permission, or if they are part of a directory tree specified with the -forbidden-directories option, Purify creates shadow directories in the global cache, <purifyhome>/cache, where it stores the cache files.

Purify lets you control how instrumented libraries and files are cached. You can:

Deleting cached object files

Since Purify rebuilds cached instrumented files as needed, you can remove them at any time in order to conserve disk space.

Using the pure_remove_old_files script

To remove cache files, use the pure_remove_old_files script located in the <purifyhome> directory. For example, to remove all instrumented cache files that are 14 days or older recursively from the root directory /, type:

% pure_remove_old_files / 14

The first argument (/) specifies the path, the second argument (14) specifies the number of days.

Using a cron job

To automate the removal of cache files, create a cron job that periodically removes the files. For example, to remove files that have not been accessed in two weeks, type:

% crontab -e

Add this entry to the crontab file:

15 2 * * * <purifyhome>/pure_remove_old_files / 14

This runs pure_remove_old_files each day at 2:15 am, and removes all cached files starting at the root directory / that have not been read within the last 14 days.

To remove all of the cache files in the current directory and subdirectories, use:

% pure_remove_old_files . 0

This is useful in clean targets of makefiles.