-
Notifications
You must be signed in to change notification settings - Fork 235
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
Setting explicit autorelease frequency #579
Setting explicit autorelease frequency #579
Conversation
Related to #563 |
@adamwulf can you please pull in the latest changes from master? they include some CI config changes that will fix your CI failure. |
Ah! sorry, saw this a bit too late. glad it was still able to get merged in. Thanks! |
@adamwulf no worries. we'll get a new release out soon. |
Late to the party on this one, so what exactly will this change do? Does |
|
Thanks! I need to learn more about this it seems. https://developer.apple.com/documentation/dispatch/dispatchqueue/2300059-init Seems to suggest that the default is .inherit, not .never? Some background stuff I've found:
https://stackoverflow.com/questions/38884418/autoreleasefrequency-on-dispatchqueue-in-swift-3 So the mixpanel-swift lib is pure swift right, so maybe this won't actually effect things? Either way I don't think this change will hurt anything, just trying to to understand it incase we see weird behavior in the future. |
my understanding is that the pool will eventually be drained because of i believe there are still cases in Swift that are bridged to Obj-C behinds the scenes, so even in a pure swift codebase there may still be obj-c objects being created/destroyed. |
I was seeing large memory growth when offline with lots of items waiting to be flushed to the mp service. i had ~5000 events queued while offline, and the work done on these dispatch queues wasn't getting cleaned up, causing an explosion in otherwise collectable memory.
my understanding is that
DispatchQueue()
will default toautoreleaseFrequency=.never
, which can leave those autoreleased objects hanging around in memory for undefined amounts of time.