Skip to content
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

PlatformUtil Memory Leak #215

Closed
ryan-hodgman opened this issue Oct 10, 2018 · 4 comments
Closed

PlatformUtil Memory Leak #215

ryan-hodgman opened this issue Oct 10, 2018 · 4 comments

Comments

@ryan-hodgman
Copy link

@ryan-hodgman ryan-hodgman commented Oct 10, 2018

Environment

  1. OS: Compiled on Mac
  2. Version: 1.11
  3. Device(s): Pixel 2, but assumedly all Android devices

Description

We've recently recorded a number of crashes caused by java.lang.OutOfMemoryErrors. We installed LeakCanary to hunt down the issue and started receiving leak reports related to an internal PlatformUtil class and the mContext that it holds.

It would seem that when an instance of ViroViewARCore is disposed of it only nullifies its PlatformUtil instance, rather than explicitly disposing of it (ViroViewARCore:348). This becomes an issue because the PlatformUtil has a Context reference that is only nullified when the PlatformUtil instance is finalized (PlatformUtil:95), which does not necessarily align with when the Activity is destroyed. The result is that the Activity instance is leaked beyond its destruction.

Could we please explicitly tidy up this PlatformUtil#mContext reference upon activity destruction? It seems to be at least contributing to the OOM exceptions we've been experiencing.

@achuvm
Copy link
Collaborator

@achuvm achuvm commented Oct 11, 2018

Hi @ryan-hodgman,

Thanks for the very detailed bug report, we'll fix this issue in our next release.

@ryan-hodgman
Copy link
Author

@ryan-hodgman ryan-hodgman commented Oct 12, 2018

Awesome, I look forward to it. Thanks for your responsiveness. 👍

@manbod
Copy link
Collaborator

@manbod manbod commented Nov 19, 2018

Hi @ryan-hodgman ,
We just released ViroCore 1.12.0. We fixed a few memory leaks in this update. Docs here -> https://virocore.viromedia.com/v1.12.0/docs/releases . Let us know if you still see the same leaks.

@manbod manbod closed this Nov 19, 2018
@ryan-hodgman
Copy link
Author

@ryan-hodgman ryan-hodgman commented Nov 20, 2018

Awesome news, thanks! 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants