This My Test cases, point out that when using NSURLSession with a HTTP/2 connection there is memory problem.
test1: iOS 9. HTTP/2 server
I use
From apple doc:
The session object keeps a strong reference to the delegate until your app exits or explicitly invalidates the session. If you don’t invalidate the session, your app leaks memory until it exits.
Also looking at your project https://github.com/upyun/swift-sdk/tree/testleak you need to call finishTasksAndInvalidate() after sessionTask.resume() since you are creating session per request