You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
nix-store --optimise can replace a file that is currently gc-rooted by a running process with a hardlink to a file with the same contents. this doesn't save the space of the replaced copy until the process that uses the copy is restarted, and shows up with "executable was deleted" markers in process monitors like htop.
Describe the solution you'd like
don't replace files that are currently mapped by executables unless every copy is in use.
Describe alternatives you've considered
leaving things as is would probably be fine? that delays some of the space savings reported by the optimisation process though, and is pretty confusing at first glance.
The text was updated successfully, but these errors were encountered:
Not sure this is a good idea. As you point out, the space savings eventually happen, and detecting whether a file is open sounds tricky and subject to race conditions.
to not confuse process monitors it would probably be sufficient to not replace executables/libraries that are currently mapped, and we do track those as gc roots. does that sound better?
if the current behaviour stays it might be a good idea to add a sentence about it to the documentation, eg "This operation may replace executable or library paths of running processes with hardlinks, making them show up as deleted in /proc." certainly confused me when we first saw it happen.
Is your feature request related to a problem? Please describe.
nix-store --optimise can replace a file that is currently gc-rooted by a running process with a hardlink to a file with the same contents. this doesn't save the space of the replaced copy until the process that uses the copy is restarted, and shows up with "executable was deleted" markers in process monitors like htop.
Describe the solution you'd like
don't replace files that are currently mapped by executables unless every copy is in use.
Describe alternatives you've considered
leaving things as is would probably be fine? that delays some of the space savings reported by the optimisation process though, and is pretty confusing at first glance.
The text was updated successfully, but these errors were encountered: