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

PLAT-10762 fix android breadcrumb memory leak #738

Merged
merged 4 commits into from
Aug 17, 2023

Conversation

richardelms
Copy link
Contributor

Goal

Some AndroidJavaObject instances were not properly Disposed when passing breadcrumbs through to the native android layer.

Changeset

  • Added a disposable container class that tracks all created objects and disposes of them after use.

Testing

Created an example app that, when using the latest release, always crashed within 2 seconds of launching due to the leak.
Then rebuilt the app with a new build containing the fix and left it running with a profiler attached for 30 mins. It did not crash and memory usage remaind constant.

@richardelms richardelms self-assigned this Aug 17, 2023
Copy link
Contributor

@lemnik lemnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - With some ideas

src/BugsnagUnity/Native/Android/NativeInterface.cs Outdated Show resolved Hide resolved
@richardelms richardelms merged commit 8e2b96b into next Aug 17, 2023
9 checks passed
@richardelms richardelms deleted the 10762-fixAndroidmemoryLeak branch August 17, 2023 12:36
@richardelms richardelms mentioned this pull request Aug 17, 2023
@jchowdown
Copy link

out of curiosity, do we know when this bug was introduced?

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

Successfully merging this pull request may close these issues.

None yet

4 participants