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: profiling memory growth fix #3145

Merged
merged 3 commits into from
Jul 14, 2023

Conversation

armcknight
Copy link
Member

Following on from #3133, write a test that exercises the situation that is causing the memory growth bug. We actually already had a test that sets up the scenario, but prior to being able to mock backtraces, which that linked PR provides the ability to do, we were not able to distinguish which profile data comes from which profiler–and therefore tell that one had been lost. Now that we can disambiguate them with different mock data, we can ensure both are preserved. This test should fail in this PR and then pass in #3135 with the fixes.

#skip-changelog

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM, but the tests are failing.

@armcknight
Copy link
Member Author

The test is supposed to fail in this PR. We'll merge #3135 which is the fix into this branch before merging this to main.

- always ensure the profiler's timeout timer is scheduled on the main thread
- keep references to any aborted profiler until its associated transaction is finished
@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #3145 (f24e9a7) into main (591a01b) will increase coverage by 0.020%.
The diff coverage is 91.787%.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #3145       +/-   ##
=============================================
+ Coverage   89.108%   89.129%   +0.020%     
=============================================
  Files          501       501               
  Lines        53867     53951       +84     
  Branches     19298     19327       +29     
=============================================
+ Hits         48000     48086       +86     
+ Misses        5011      4898      -113     
- Partials       856       967      +111     
Impacted Files Coverage Δ
Sources/Sentry/SentryNSNotificationCenterWrapper.m 85.714% <ø> (ø)
Sources/Sentry/SentryProfiler.mm 79.672% <81.818%> (+1.585%) ⬆️
Sources/Sentry/SentryTracerConcurrency.mm 95.081% <94.000%> (-4.919%) ⬇️
Sources/Sentry/SentryFramesTracker.m 98.449% <100.000%> (ø)
Sources/Sentry/SentryScreenFrames.m 67.857% <100.000%> (+12.857%) ⬆️
Sources/Sentry/SentryTracer.m 96.254% <100.000%> (-0.388%) ⬇️
...SentryProfilerTests/SentryProfilerSwiftTests.swift 97.231% <100.000%> (+0.167%) ⬆️
Tests/SentryProfilerTests/SentryProfilerTests.mm 98.333% <100.000%> (+0.098%) ⬆️
...ance/FramesTracking/SentryFramesTrackerTests.swift 98.742% <100.000%> (-0.016%) ⬇️
...ts/SentryTests/Transaction/SentryTracerObjCTests.m 100.000% <100.000%> (ø)

... and 24 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 591a01b...f24e9a7. Read the comment docs.

@github-actions
Copy link

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1226.58 ms 1242.22 ms 15.64 ms
Size 22.84 KiB 402.08 KiB 379.24 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
43aa39d 1239.16 ms 1270.42 ms 31.26 ms
7bc3c0d 1259.74 ms 1268.45 ms 8.71 ms
6f4d20c 1228.67 ms 1238.88 ms 10.21 ms
984eb2d 1220.62 ms 1235.24 ms 14.62 ms
03d9eb5 1227.35 ms 1231.24 ms 3.90 ms
596ccc1 1221.57 ms 1236.82 ms 15.25 ms
1d11695 1219.57 ms 1243.52 ms 23.95 ms
6e342ac 1202.98 ms 1228.74 ms 25.76 ms
1bbcb9c 1189.61 ms 1223.50 ms 33.89 ms
06548c0 1225.58 ms 1244.70 ms 19.12 ms

App size

Revision Plain With Sentry Diff
43aa39d 20.76 KiB 432.82 KiB 412.06 KiB
7bc3c0d 20.76 KiB 427.35 KiB 406.59 KiB
6f4d20c 20.76 KiB 431.71 KiB 410.95 KiB
984eb2d 20.76 KiB 425.77 KiB 405.01 KiB
03d9eb5 20.76 KiB 436.33 KiB 415.57 KiB
596ccc1 22.84 KiB 401.44 KiB 378.60 KiB
1d11695 20.76 KiB 401.60 KiB 380.84 KiB
6e342ac 20.76 KiB 436.66 KiB 415.90 KiB
1bbcb9c 20.76 KiB 426.10 KiB 405.34 KiB
06548c0 20.76 KiB 427.35 KiB 406.59 KiB

@armcknight armcknight changed the title test: regression test to validate memory growth fix fix: profiling memory growth fix Jul 14, 2023
@armcknight armcknight merged commit 4afae53 into main Jul 14, 2023
65 of 67 checks passed
@armcknight armcknight deleted the armcknight/fix/memory-growth-regression-test branch July 14, 2023 00:42
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.

3 participants