-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fix Mac Memory leak issue #1042
Conversation
@sid-dahiya @lalitb for reference, this is the fix for memory leak issue on Mac that we saw in OneDrive. This fix worked for OneDrive so merging it to the common code. |
Getting error. @lalitb what compiler do we use? GCC or Clang compiler All examples of using autoreleasepool is in mm file. |
|
Agree with your statement, this block do not contain Obj-C object references, hence @autoreleasepool doesn't apply here |
Thanks removed the autorelease pool from WorkerThread.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM
On lighter front, @autoreleasepool user can ignore all these discussions, he is unknowingly getting added here. :) |
https://github.com/microsoft/cpp_client_telemetry_modules/issues/176
Multiple users are reporting high memory usage, especially on M1 Macs. We've made some significant gains in the last few months, but we are still running into users seeing 12+GB of usage. I've been in a thread with one such user who has provided leak traces
The "with aria" traces were collected first, in OneDrive's default configuration. The user enabled malloc_history and let the product run until it reached around 1GB usage, at which point it is my understanding that we crashed (this has to do with malloc tracing and not another bug). After that, I had the user disable Aria, and run the same trace again (the "without aria" trace). No crash this time.
From a comparison of the traces, it is obvious that Aria is responsible for significant memory consumption. What seems to be happening here (and this is consistent with when Apple looked at it) is that Aria is allocating objects inside an autoreleasepool that is never released.
What changes:
Just added autorelease pool to functions that were not releasing memory.