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

Fix UncaughtExceptionHandlerIntegration Memory Leak #3398

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

lbloder
Copy link
Collaborator

@lbloder lbloder commented Apr 30, 2024

Upon registration check if an UncaughtExceptionHandlerIntegration is already set as defaultUncaughtExceptionHandler, if so, set its defaultExceptionHandler as the default of the new UncaughtExceptionHandlerIntegration.

💡 Motivation and Context

Fixes #3266

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Apr 30, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 439.76 ms 521.98 ms 82.22 ms
Size 1.70 MiB 2.28 MiB 592.31 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4e260b3 388.40 ms 468.98 ms 80.58 ms
0bd723b 375.20 ms 452.41 ms 77.20 ms
baaf637 462.32 ms 579.22 ms 116.90 ms
8838e01 367.65 ms 447.40 ms 79.75 ms
c7e2fbc 393.98 ms 478.24 ms 84.27 ms
b172d4e 352.92 ms 446.50 ms 93.58 ms
93a76ca 397.30 ms 455.16 ms 57.87 ms
93a76ca 377.41 ms 448.22 ms 70.81 ms
7b7964f 401.31 ms 513.78 ms 112.46 ms
c554ca2 364.98 ms 433.64 ms 68.66 ms

App size

Revision Plain With Sentry Diff
4e260b3 1.72 MiB 2.27 MiB 554.95 KiB
0bd723b 1.72 MiB 2.29 MiB 578.09 KiB
baaf637 1.72 MiB 2.27 MiB 558.42 KiB
8838e01 1.72 MiB 2.29 MiB 578.15 KiB
c7e2fbc 1.72 MiB 2.29 MiB 576.40 KiB
b172d4e 1.72 MiB 2.29 MiB 578.09 KiB
93a76ca 1.72 MiB 2.29 MiB 576.75 KiB
93a76ca 1.72 MiB 2.29 MiB 576.75 KiB
7b7964f 1.70 MiB 2.28 MiB 592.12 KiB
c554ca2 1.70 MiB 2.27 MiB 582.25 KiB

Previous results on branch: fix/uncaughtexceptionhandler-memory-leak

Startup times

Revision Plain With Sentry Diff
24b2a89 397.32 ms 462.63 ms 65.31 ms
e73aac6 426.27 ms 471.55 ms 45.29 ms

App size

Revision Plain With Sentry Diff
24b2a89 1.70 MiB 2.28 MiB 592.31 KiB
e73aac6 1.70 MiB 2.28 MiB 592.31 KiB

@lbloder lbloder marked this pull request as ready for review May 1, 2024 17:11
Comment on lines +86 to +87

// defaultExceptionHandler = currentHandler;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// defaultExceptionHandler = currentHandler;

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

nice!

Copy link
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this!

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.

UncaughtExceptionHandlerIntegration leaks memory
4 participants