struct CachePruningPolicy
Declaration
struct CachePruningPolicy { /* full declaration omitted */ };
Description
Policy for the pruneCache() function. A default constructed CachePruningPolicy provides a reasonable default policy.
Declared at: llvm/include/llvm/Support/CachePruning.h:26
Member Variables
- public llvm::Optional<std::chrono::seconds> Interval = std::chrono::duration<long, std::ratio<1, 1>>(1200)
- The pruning interval. This is intended to be used to avoid scanning the directory too often. It does not impact the decision of which file to prune. A value of 0 forces the scan to occur. A value of None disables pruning.
- public std::chrono::seconds Expiration = std::chrono::duration<long, std::ratio<3600, 1>>(7 * 24)
- The expiration for a file. When a file hasn't been accessed for Expiration seconds, it is removed from the cache. A value of 0 disables the expiration-based pruning.
- public unsigned int MaxSizePercentageOfAvailableSpace = 75
- The maximum size for the cache directory, in terms of percentage of the available space on the disk. Set to 100 to indicate no limit, 50 to indicate that the cache size will not be left over half the available disk space. A value over 100 will be reduced to 100. A value of 0 disables the percentage size-based pruning.
- public uint64_t MaxSizeBytes = 0
- The maximum size for the cache directory in bytes. A value over the amount of available space on the disk will be reduced to the amount of available space. A value of 0 disables the absolute size-based pruning.
- public uint64_t MaxSizeFiles = 1000000
- This defaults to 1000000 because with that many files there are diminishing returns on the effectiveness of the cache. Some systems have a limit on total number of files, and some also limit the number of files per directory, such as Linux ext4, with the default setting (block size is 4096 and large_dir disabled), there is a per-directory entry limit of 508*510*floor(4096/(40+8))~=20M for average filename length of 40.