Open DavHau opened 1 year ago
Am I missing something here? If a package has a gcroot, it is not garbage and thus can't be collected.
I'm not really wanting to get into the business of removing gcroots. That is basically what nix-collect-garbage
's --delete-older-than
option does, and not particularly what I was trying to achieve.
atime
might be disabled on many systems and is also expensive.How about a
gc-roots with priorities
based model? Tools like direnv, for example, already create gc-roots. Those could justtouch
the roots on each use. The garbage collector then just needs to delete all gc-root which haven't been used since 30days and do a standard garbage collect.Advantages:
Disadvantages:
Alternatives:
An alternative approach that doesn't have the disadvantage mentioned above: Enable atime only on
/nix/var/nix/gcroots
and use those to determine theage
of a gcroot. But now the downside is that this might require changing the partitioning scheme.