sentry-java
sentry-java copied to clipboard
Fix UncaughtExceptionHandlerIntegration Memory Leak
Upon registration check if an UncaughtExceptionHandlerIntegration is already set as defaultUncaughtExceptionHandler, if so, set its defaultExceptionHandler as the default of the new UncaughtExceptionHandlerIntegration.
:bulb: Motivation and Context
Fixes #3266
:green_heart: How did you test it?
:pencil: 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
sendDefaultPIIis 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.
:crystal_ball: Next steps
Performance metrics :rocket:
| Plain | With Sentry | Diff | |
|---|---|---|---|
| Startup time | 372.02 ms | 439.62 ms | 67.60 ms |
| Size | 1.70 MiB | 2.28 MiB | 592.99 KiB |
Baseline results on branch: main
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| baaf6371cb120f45ad4fed59e8b97e65e3381cfd | 462.32 ms | 579.22 ms | 116.90 ms |
| 28c9a83af55b119517dbd2fcf74975fb5822907b | 416.98 ms | 479.90 ms | 62.92 ms |
| 201048a0cf146f24a001d1c7997aae2ef84b23c3 | 418.62 ms | 481.67 ms | 63.05 ms |
| 7ab32b6ab8bc72b973328a00840eb192b151b59f | 373.62 ms | 480.61 ms | 106.99 ms |
| b172d4ed57bfa46dfac6bee0216bea7d0126b253 | 352.92 ms | 446.50 ms | 93.58 ms |
| 3d8bd2ba0c81c9aa6084fa222f9a7706cf5e8d92 | 364.76 ms | 469.98 ms | 105.22 ms |
| 1e05e43aac4e7f22213e0ec71fa5a89a74588c91 | 411.00 ms | 467.29 ms | 56.29 ms |
| c554ca260c5f0fa79a30d592f6c0e08a850a5014 | 383.78 ms | 449.84 ms | 66.06 ms |
| 0bd723b1c59af639c4a86bbade526e0108096f8e | 375.20 ms | 452.41 ms | 77.20 ms |
| 99a51e2957c3044db1b481b67e733b42ee267926 | 405.11 ms | 479.65 ms | 74.54 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| baaf6371cb120f45ad4fed59e8b97e65e3381cfd | 1.72 MiB | 2.27 MiB | 558.42 KiB |
| 28c9a83af55b119517dbd2fcf74975fb5822907b | 1.70 MiB | 2.28 MiB | 592.00 KiB |
| 201048a0cf146f24a001d1c7997aae2ef84b23c3 | 1.70 MiB | 2.28 MiB | 592.32 KiB |
| 7ab32b6ab8bc72b973328a00840eb192b151b59f | 1.70 MiB | 2.27 MiB | 584.63 KiB |
| b172d4ed57bfa46dfac6bee0216bea7d0126b253 | 1.72 MiB | 2.29 MiB | 578.09 KiB |
| 3d8bd2ba0c81c9aa6084fa222f9a7706cf5e8d92 | 1.72 MiB | 2.29 MiB | 577.53 KiB |
| 1e05e43aac4e7f22213e0ec71fa5a89a74588c91 | 1.70 MiB | 2.28 MiB | 590.89 KiB |
| c554ca260c5f0fa79a30d592f6c0e08a850a5014 | 1.70 MiB | 2.27 MiB | 582.25 KiB |
| 0bd723b1c59af639c4a86bbade526e0108096f8e | 1.72 MiB | 2.29 MiB | 578.09 KiB |
| 99a51e2957c3044db1b481b67e733b42ee267926 | 1.72 MiB | 2.29 MiB | 576.34 KiB |