Allow stopping scanning while preserving results
Currently, gdu has an initial "scan" phase where it scans the disk and then once the scanning is complete, it allows results to be viewed. Stopping the scanning at any time, quits the app.
Instead of quitting, do you think it would make sense to stop scanning and showing whatever has been scanned till now?
This would help in cases where scanning is taking too much time, like a 60 TeraByte NFS disk!
I had to stop GDU which had already scanned 300,000,000 items totalling about 14 TB because it was taking 80GB of RAM & 8 cores on the server. The cores were expected, but the excessive memory usage was not.
If GDU could've just stopped the scanning, I would have still made sense of whatever it had scanned.
I'm back to using ncdu now which is going at a snails pace, but atleast it will finish in a day or two without completely borking the system :(
Hi, interesting idea, should be possible to do that. I will try it in the next days.
About the memory usage: Gdu is not doing garbage collection if the server has a lot of free RAM. If the free RAM is decreasing, garbage collection is enabled and set as more aggressive as less memory is available.
You can start gdu with logging (-l) and see if this works correctly. There should be lines setting GC percent to and a number which should be decreasing as less memory is available.
You can also tell gdu to use constant garbage collection aggressiveness using e.g.:
GOGC=20 gdu -g
(the lower the number, the more will gdu try to lower memory usage)
What is the default value of GOGC variable? How much of a performance hit would it be to set GOGC to 20 / 10 etc?
I'm just wondering what is the downside of something like alias gdu="GOGC=20 gdu"
Default is 100. It depends on many circumstances (mainly how much free RAM the machine has versus how big the drive is). If there is a lot of RAM (so default setting of gdu will not call GC at all during analysis), the penalty of setting GOGC=20 (and setting -g) can be approx 2x slower run.