GCDAsyncUdpSocket sendData to cause memory leak in IOS9
Anyone can create a timer send data to self every 0.01s use GCDAsyncUdpSocket, then show the debug navigator. You can see the memory use rapid growth.
Maybe here's the question
[self asyncResolveHost:host port:port withCompletionBlock:^(NSArray *addresses, NSError *error) {
packet->resolveInProgress = NO;
packet->resolvedAddresses = addresses;
packet->resolveError = error;
if (packet == currentSend)
{
LogVerbose(@"currentSend - address resolved");
[self doPreSend];
}
}];
dispatch_async(socketQueue, ^{ @autoreleasepool {
[sendQueue addObject:packet];
[self maybeDequeueSend];
}});
in this function
- (void)sendData:(NSData *)data withTimeout:(NSTimeInterval)timeout tag:(long)tag;
a simple example udpTest.zip
I also met the problem, in ios9,Memory not release
@liusibin How did you solve the problem?
+1 I've also the same memory increasing and not releasing problem with the CocoaMQTT Framework base on CGDAsyncSocket in iOS9. Any temporary solutions to fix this problem would be appreciated :) Maybe there is a relation with : GCDAsyncSocket.m:7923:75: 'kCFStreamNetworkServiceTypeVoIP' is deprecated: first deprecated in iOS 9.0 - use PushKit for VoIP control purposes Thanks
@puga1024 : I also think there's a problem in that part of the code, I commented here
https://github.com/robbiehanson/CocoaAsyncSocket/issues/390#issuecomment-188453264
with an ugly hack , which seems to have stopped the leak in my case.