Storage Constraints in PhpStorm Local History
PhpStorm does not currently provide a configuration to set a maximum disk space quota (e.g., a hard cap in gigabytes) for Local History snapshots. The IDE manages storage primarily through a time-based expiration policy rather than a volume-based one.
Retention Period Scope
The Retention period setting is a global configuration. It cannot be defined on a per-project basis. Once set in the IDE settings, the same number of days applies to all projects managed by that specific IDE installation.
Managing Disk Space Consumption
Because there is no storage quota, users dealing with large files or limited disk space must rely on the following methods to control the system folder growth:
- Reduce Global Retention: Lower the number of days in
Settings | Appearance & Behavior | System Settings | Local History. This triggers more frequent purging of old snapshots.
- Manual Cache Clear: If the system folder has grown excessively, you can use
File | Invalidate Caches.... While this primarily targets indexes, it can help reset certain IDE overheads.
- Exclude Large Directories: Ensure that large data folders, build artifacts, or dependency directories (like
node_modules) are marked as Excluded in the project structure. PhpStorm typically avoids tracking Local History for excluded folders, preventing them from bloating the snapshot database.
Verification of Storage Usage
To determine how much space Local History is consuming, you can locate the system folder on your machine. The path varies by OS but generally follows this pattern:
<User Home>/.cache/JetBrains/PhpStorm<Version>/system/localHistory
Checking the size of this directory will confirm if the retention period is sufficient for your available disk space.
Diagnostic Detail Required
Are you tracking extremely large binary files (e.g., database dumps or large assets) within your project root? If so, the recommendation shifts from adjusting retention periods to implementing strict directory exclusions.