Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUMM-610 Hotfix for memory leaks on data upload #180

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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