Skip to content
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

nix-collect-garbage is slow on OS X because of lsof #3011

Open
basvandijk opened this issue Jul 30, 2019 · 2 comments
Open

nix-collect-garbage is slow on OS X because of lsof #3011

basvandijk opened this issue Jul 30, 2019 · 2 comments
Labels

Comments

@basvandijk
Copy link
Member

basvandijk commented Jul 30, 2019

nix-collect-garbage uses lsof on OS X to find all opened files by all processes in order to not collect opened files:

tokenizeString<std::vector<string>>(runProgram(LSOF, true, { "-n", "-w", "-F", "n" }), "\n");

Unfortunately lsof is really slow on OS X. On my Macbook Pro lsof takes more than 6 seconds:

time lsof -n -w -F n > /dev/null
lsof -n -w -F n > /dev/null  0.24s user 6.01s system 99% cpu 6.252 total

This actually caused the gc-concurrent.sh test to fail because nix-collect-garbage takes longer to run than the nix build started earlier.

@stale
Copy link

stale bot commented Feb 18, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 18, 2021
@stale
Copy link

stale bot commented Apr 28, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this as completed Apr 28, 2022
@thufschmitt thufschmitt reopened this Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants