memory leak
When I use the method "- (void)readDataWithTimeout:(NSTimeInterval)timeout tag:(long)tag", and I sent 10 bytes/0.1s to the socket from server-side, I found memory leak.
Use Instruments tool (in XCode) to check memory leak. I saw GCDAsyncReadPacket not release.
When setting "currentRead = nil", but the memory pointed by currentRead is not released and its reference count is not zero.
I also encountered the same problem. But only in iOS9
resolving...
在 2015-12-19 11:08:47,"germ1107" [email protected] 写道:
I also encountered the same problem. But only in iOS9
— Reply to this email directly or view it on GitHub.
Any one knows what's going on ? Does it solved?
Does it solved?
Even I have problem and it is leading to crash .. Any kind of help ll ve much appreciated Thank you
Hey,i find a answer that says it's about "Xcode memory usage feature ", https://github.com/robbiehanson/CocoaAsyncSocket/issues/390 but i'm not sure whether it's the same problem .
I'm not sure if it's related to this specific leak, but I'm getting a memory leak with GCDAsyncUdpSocket sendData:toHost port withTimeout tag.
I have a simple test app to re-create the problem if someone wouldn't mind looking into it.
I'm also getting a memory leak in my app when running on an iOS 9 device.
I am also getting a memory leak. Testing shows that memory usage increases with every write on a server socket. The memory is released if the client disconnects. Is there a method to flush the read and/or write buffer?
Does it solved?I need your help.
@Enigma644 @deannerene
I'm also getting massive memory increase without being freed on GCDAsyncUdpSocket sendData:toHost port withTimeout tag.
To further confirm this, I wrote a test method in Swift 3 (Xcode 8 beta 4):
let data = Data(bytes: [00])
for _ in 0...500000 {
UDPSock.send(data, toHost: "192.168.0.150", port: 8001, withTimeout: 2, tag: 0)
}
Then watched my app's debug stats and within seconds memory usage increased to 4GB and stopped responding.
I paused execution in Xcode and looked at the objects that were obviously being created in large numbers and these showed up (and their instance count in parentheses):
- App → GCDAsyncUdpSendPacket (433205)
- Foundation → _NSInlineData (467712)
- libswiftFoundation.dylib → _SwiftNSData (433205)
- CoreFoundation →
- NSArray (Object Storage) (34806)
- NSMutableArray (34821)
- NSMallocBlock (1262800)
- libswiftCore.dylib → _NSContiguousString (398769)
Inspecting the contents of some of these elements, it was clear that many contained assets related to the packet being sent, such as NS data containing the IP address etc.
This issue has been marked as stale, it will be closed automatically if there is no further activity.