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-9307] add autorelease pool to fix memory leak #1507

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

kstenerud
Copy link
Contributor

@kstenerud kstenerud commented Dec 7, 2022

Goal

BSGAppHangDetector was running a pthread but was calling objc methods with no autorelease pool, causing a memory leak each time it detected an app stall.

Changeset

Wrap the thread's main function in an @autoreleasepool

Testing

Verified the leak and fix with the allocations profiler on a real device.

@github-actions
Copy link

github-actions bot commented Dec 7, 2022

Bugsnag.framework binary size increased by 176 bytes from 706,120 to 706,296

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +1.7%     +72  +1.7%     +72    Lazy Binding Info
  +0.0%     +56  +0.0%     +56    String Table
  +0.0%     +52  +0.0%     +52    __TEXT,__text
  +0.0%     +32  +0.0%     +32    Symbol Table
  +1.1%     +24  +1.1%     +24    __TEXT,__stub_helper
  +1.2%     +24  +1.2%     +24    __TEXT,__stubs
  +1.0%     +16  +1.0%     +16    Indirect Symbol Table
  +1.2%     +16  +1.2%     +16    __DATA,__la_symbol_ptr
  -0.2%     -16  -0.1%     -16    [__DATA]
  -0.4%    -100  -0.4%    -100    [__TEXT]
  [ = ]       0  -1.2%    -176    [__LINKEDIT]
  +0.0%    +176  [ = ]       0    TOTAL

Generated by 🚫 Danger

@kstenerud kstenerud marked this pull request as ready for review December 7, 2022 12:55
@kstenerud kstenerud changed the title [PLAT-9307] autorelease pool [PLAT-9307] add autorelease pool to fix memory leak Dec 7, 2022
@kstenerud kstenerud merged commit ed2e0fc into next Dec 7, 2022
@kstenerud kstenerud deleted the PLAT-9307-autorelease-pool branch December 7, 2022 13:27
@kstenerud kstenerud mentioned this pull request Dec 7, 2022
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.

2 participants