New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: garbage collect based on age #1680
Comments
Nix once had this feature but it was removed: 8824d60 |
We could probably maintain times in the database rather than atimes. But I don't know if that causes a bunch of other annoyances. |
Yeah, it would mean that every evaluation causes a huge number of updates in the database. Though I guess that could be done asynchronously. |
@edolstra But doesn't NixOS still have relatime? Isn't that good enough? |
I marked this as stale due to inactivity. → More info |
😢 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/replacing-builtins-fetchtarball-with-pkgs-fetchfromgithub/18383/11 |
The idea of "collecting garbage" is to delete things which aren't useful anymore, i.e., aren't likely to be used. The most direct heuristic for this is how long it's been since the last time something was used. For outputs that have no references (i.e., candidates for garbage collection), the ones that are used frequently (in builds) are less useful to garbage collect than the ones that haven't been used in a long time. So it seems logical that keeping track of the "age" of reference-less entries in the Nix store would be useful for implementing an option like:
As a developer, I would personally find this very useful, and I'm sure others would as well.
The text was updated successfully, but these errors were encountered: