Skip to content

Commit

Permalink
Merge pull request #180 from DataDog/ncreated/RUMM-610-fix-memory-lea…
Browse files Browse the repository at this point in the history
…ks-in-data-upload

RUMM-610 Hotfix for memory leaks on data upload
  • Loading branch information
ncreated authored Jul 15, 2020
2 parents 78e11be + 0b22fc0 commit fb59e41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Datadog/Core/Upload/HTTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ internal final class HTTPClient {

convenience init() {
let configuration: URLSessionConfiguration = .ephemeral
// NOTE: RUMM-610 Default behaviour of `.ephemeral` session is to cache requests.
// To not leak requests memory (including their `.httpBody` which may be significant)
// we explicitly opt-out from using cache. This cannot be achieved using `.requestCachePolicy`.
configuration.urlCache = nil
// TODO: RUMM-123 Optimize `URLSessionConfiguration` for good traffic performance
// and move session configuration constants to `PerformancePreset`.
self.init(session: URLSession(configuration: configuration))
Expand Down

0 comments on commit fb59e41

Please sign in to comment.