NC 1.4.0 - Memory Leak when opening directories in Google Drive [FIXED]
NC 1.4.0 - Memory Leak when opening directories in Google Drive [FIXED]
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!
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 352 times
Re: NC 1.4.0 - Memory Leak when opening directories in Google Drive
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)
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
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!
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 (490.1 KiB) Viewed 15171 times
Re: NC 1.4.0 - Memory Leak when opening directories in Google Drive
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.
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]
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]
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]
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]
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.
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]
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!
------
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!