Page 1 of 1

NC 1.4.0 - Memory Leak when opening directories in Google Drive [FIXED]

Posted: Thu Sep 01, 2022 3:15 pm
by GuiB
I'm seeing a big memory leak from Nimble Commander 1.4.0 when I'm working inside my Google Drive directory. I think it is happening when the internal files are not downloaded in my computer completely.

When I try to open one, Nimble Commander doesn't freeze, but I can't change directories and the used memory by NC increase drastically rapidly. I'm attaching a sampling analysis while the memory leak occur.

Thanks and all the best!

Re: NC 1.4.0 - Memory Leak when opening directories in Google Drive

Posted: Sat Sep 03, 2022 8:09 pm
by mike
Hi, thanks for reporting the issue, that's concerning for sure.
I've found a place that might be a culprit of such behaviour.
Does Google Drive work as a custom file system on macOS? (I'm not using it personally)

Re: NC 1.4.0 - Memory Leak when opening directories in Google Drive

Posted: Mon Sep 05, 2022 7:10 pm
by GuiB
Dear Mike, sorry for the delay I didn't get a notification...

Yes Google Drive seems to work as a custom file system since it mount in Finder as an attached drive and the files get downloaded when I open them or I need to "make them accessible offline" by invoking this function from the context menu by selecting a file or folder. I'm attaching a screenshot to show you how the drive is mounted and how it looks when the file are not downloaded.

Please let me know if I can help you further! In the meantime, I guess I could make it work reliably by selecting the base directory and make it accessible offline.

Thanks and all the best!

Re: NC 1.4.0 - Memory Leak when opening directories in Google Drive

Posted: Sat Oct 08, 2022 1:56 pm
by mike
Found the root cause, the next preview and/or release (v1.4.0) will behave as expected.
This seem to be an Apple's problem with their relatively new API - File Providers for cloud storage.
In short, these directories are initially SF_DATALESS and fetching ATTR_DIR_ENTRYCOUNT via getattrlist() reports that such a directory has 1'431'194'446 entries instead of erroring out somehow or triggering a background download as a directory iteration normally does.
So what appeared as a memory leak was Nimble Commander laboriously preallocating memory to read 1'431'194'446 entries from the directory.

Re: NC 1.4.0 - Memory Leak when opening directories in Google Drive [FIXED]

Posted: Fri Oct 21, 2022 12:01 am
by GuiB
Dear Mike, thanks for the update! Build 3838 seems to have fixed the issue, thanks!

Re: NC 1.4.0 - Memory Leak when opening directories in Google Drive [FIXED]

Posted: Thu Oct 27, 2022 2:23 am
by GuiB
Hi Mike, I spoke a little too fast... Build 3838 fixed most of the problem (I can now navigate most of my Google Drive). However, I still get a big memory leak when I try to access a directory that wasn't previously accessed with Finder. Nimble Commander seems to scan the directory and allocate a big section of memory.

Re: NC 1.4.0 - Memory Leak when opening directories in Google Drive [FIXED]

Posted: Tue Nov 01, 2022 9:25 pm
by mike
Interesting, I think these scenarios worked for me. Will look into it again, likely to ditch this buggy API altogether.

Re: NC 1.4.0 - Memory Leak when opening directories in Google Drive [FIXED]

Posted: Sun Dec 18, 2022 2:14 pm
by mike
Hi, could you please try this preview build to check if the issue is gone on your setup?
https://magnumbytes.com/downloads/previ ... (3861).dmg
I removed the usage of that buggy API entirely.

Re: NC 1.4.0 - Memory Leak when opening directories in Google Drive [FIXED]

Posted: Fri Dec 23, 2022 8:36 pm
by GuiB
Hi Mike, sorry I didn't see your reply before now... I just downloaded your new version, I'll let you know if I get into this bug again or not! Thanks!

------
UPDATE:

I just went inside my Google Drive directories and looked around almost all my directories and I didn't have a glitch! So, I think now it is fixed! I think it feels snappier as well! There were some directories that took a second to open instead of feeling instant even if there were only a few files inside, but that's about it, everything loaded correctly and the memory used by Nimble Commander stayed quite low (now at 167.4 Mo).

I'll let you know if this happens again by using Nimble Commander normally

Thanks again!