Hi,
I am uploading a large file, and have checked this scenario for memory leaks with Instruments.
It reports 5 leaked objects (about 250 bytes).
I have tested on Simulator for iPhone 6. I am linking with iOS / SDK 10.3.
Actually, I am using only the NSURLSession method
- uploadTaskWithRequest:fromFile:completionHandler:
and the NSURLSessionTaskDelegate method for the authentication
- URLSession:task:didReceiveChallenge:completionHandler:
As far as I understand, the root cause is some kind of intermediate error which happens during the transmission, and the error object (NSCFError) leaks.
Instruments shows me the calling tree of the leak very deep in the system.
In the console I see error messages like
[] nw_endpoint_handler_add_write_request [21.1 ::1.7779 failed socket-flow (satisfied)] cannot accept write requests
[] tcp_connection_write_eof_block_invoke Write close callback received error: [22] Invalid argument
or:
[] nw_socket_write_close shutdown(9, SHUT_WR): [57] Socket is not connected
[] nw_endpoint_flow_service_writes [9.1 ::1.7779 ready socket-flow (satisfied)] Write request has 0 frame count, 0 byte count
[] tcp_connection_write_eof_block_invoke Write close callback received error: [89] Operation canceled
I am out of ideas how to continue with my analysis.
Should I worry about this? (after all, it is „only“ 250 bytes, and it does not happen every time).
Is there any known issue with NSURLSession related to this?