-
Notifications
You must be signed in to change notification settings - Fork 58
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
Memory Leak from the AWSAppSyncClient #13
Comments
Thanks for the detailed report. We will look into removing these references as much as possible. |
We should have patched the issues here in version 2.6.20. Re-open if necessary |
Hello, |
We will look into removing this in the next release. |
Please see version 2.6.21 |
What happened:
When working off from the official sample app, aws-mobile-appsync-events-starter-android,
I kept getting memory leaks from the AWSAppSyncClient instance,
which is declared as a static volatile variable in ClientFactory.java.
AppSync SDK Versions tried : 2.6.16 & 2.6.19
What I have tried:
--> This solved the memory leak from the AwsAppSyncClient instance.
--> But I got more memory leaks from
1. AppSyncOfflineMutationManager, which references mContext
(I guess I can pass in a custom Executor when instantiating an AWSAppSyncClient instance, but I couldn't figure out quite how to do this)
Some parts of the code in the SDK hold on to the references to the Context.
I can't think of a good way to clear these references for the garbage collection to work correctly when the application is finished. Would making the SDK receive a WeakReference of Context be a solution to this problem?
If there are errors in the way I set up my project or my understanding of the code is incorrect,
please let me know.
The text was updated successfully, but these errors were encountered: