IntelliJ IDEA Local History pruning limits and disk space triggers
0 reputation · 27 Jan 2025, 07:49 UTC
0 reputation · 27 Jan 2025, 07:49 UTC
IntelliJ IDEA 2024.1 allows users to configure the Local History retention policy via Appearance & Behavior | System Settings | Local History. This feature defines a maximum number of retention days and a maximum size in megabytes to prevent the local repository from consuming excessive disk space.
According to the documentation, the IDE should automatically prune older history entries when either the time limit is reached or the configured maximum size is exceeded. However, it is unclear how the pruning mechanism interacts with actual system disk pressure versus the internal size limit settings.
There is uncertainty regarding whether pruning is triggered in real-time or only during specific IDE lifecycle events, such as restarts or database access. This creates a gap in understanding why entries may persist beyond the configured limits when the physical disk is nearly full.
Local History max size setting over actual available system disk space?35275 reputation · 27 Jan 2025, 13:38 UTC
IntelliJ IDEA prioritizes its configured Local History limits over actual free disk space. The retention period in days and the maximum size in megabytes are the governing triggers. The IDE does not proactively prune history merely because the operating system reports low disk space unless the internal size limit is also reached.
Pruning is not a real-time response to OS disk-pressure events. It runs as an asynchronous background maintenance operation tied to the internal Local History database lifecycle and the commitment of new history entries. Entries can therefore persist past the configured limits for some time, particularly during active editing or when the IDE has not restarted.
| Statement | Assessment |
|---|---|
| Configured max size and retention days drive pruning | Consistent with settings behavior |
| Pruning is asynchronous and backgrounded | Likely; exact interval not documented |
| OS disk-full conditions do not force immediate pruning | Likely; no evidence of real-time disk monitoring |
| IDE restarts or database access may surface maintenance | Likely; lifecycle-dependent |
Settings or Preferences, then Appearance & Behavior > System Settings > Local History.Retention period and Maximum size values.~/Library/Application Support/JetBrains/IntelliJIdea2024.1 on macOS, ~/.local/share/JetBrains/IntelliJIdea2024.1 on Linux, and %LOCALAPPDATA%\JetBrains\IntelliJIdea2024.1 on Windows.du -sh "$HOME/Library/Application Support/JetBrains/IntelliJIdea2024.1/system/localHistory"
Compare the result with the configured MB limit. If the directory is below the limit while the physical disk is full, the behavior matches an internal quota rather than a response to OS pressure.
Is the IDE system folder on the same volume that is running out of disk space? This determines whether low disk space on another mount point is relevant to Local History pruning.
system/localHistory directory size after several hours of normal editing to observe whether pruning eventually reduces it below the configured limit.localHistory directory. The IDE rebuilds it on the next start. This is destructive and should only be done with explicit acceptance of data loss.This answer assumes IntelliJ IDEA 2024.1, default installation paths, and Local History enabled. The exact pruning schedule and whether restarts force a full sweep are not publicly documented, so timing claims are marked for review and require human verification before publication.
Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 27 Jan 2025, 08:29 UTC
In IntelliJ IDEA 2024.1, Local History pruning is event-driven: it runs when a new change is written to the Local History database, not when the host disk runs low or on a fixed schedule. The IDE enforces the configured maximum size against the logical size of that database only; it does not monitor available disk space on the operating system. During each cycle, age-based entries are evaluated first, then size-based removal deletes the oldest records until both the day and megabyte limits are satisfied. Because cleanup happens on a background thread, the .idea/localHistory folder may temporarily exceed the limit. You can confirm trigger timing in the IDE log via Help | Show Log in Explorer.