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

Questions, glitches, bugs and crashes
Post Reply
GuiB
Posts: 4
Joined: Thu Sep 01, 2022 3:04 pm

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

Post by GuiB » Thu Sep 01, 2022 3:15 pm

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!
Attachments
Nimble Commander-Sample-GoogleDrive-MemoryLeak-20220901.zip
(31.56 KiB) Downloaded 27 times

User avatar
mike
Posts: 985
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

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

Post by mike » Sat Sep 03, 2022 8:09 pm

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)

GuiB
Posts: 4
Joined: Thu Sep 01, 2022 3:04 pm

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

Post by GuiB » Mon Sep 05, 2022 7:10 pm

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!
Attachments
Capture d’écran, le 2022-09-05 à 15.02.57.png
Capture d’écran, le 2022-09-05 à 15.02.57.png (490.1 KiB) Viewed 409 times

User avatar
mike
Posts: 985
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

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

Post by mike » Sat Oct 08, 2022 1:56 pm

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.

GuiB
Posts: 4
Joined: Thu Sep 01, 2022 3:04 pm

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

Post by GuiB » Fri Oct 21, 2022 12:01 am

Dear Mike, thanks for the update! Build 3838 seems to have fixed the issue, thanks!

GuiB
Posts: 4
Joined: Thu Sep 01, 2022 3:04 pm

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

Post by GuiB » Thu Oct 27, 2022 2:23 am

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.

User avatar
mike
Posts: 985
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

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

Post by mike » Tue Nov 01, 2022 9:25 pm

Interesting, I think these scenarios worked for me. Will look into it again, likely to ditch this buggy API altogether.

Post Reply