From 0b22fc0068c7528cf824354fba252f9dfe0a175f Mon Sep 17 00:00:00 2001 From: Maciek Grzybowski Date: Tue, 14 Jul 2020 18:48:18 +0200 Subject: [PATCH 1/3] RUMM-610 Fix data upload memory leaks by opting-out from using cache --- Sources/Datadog/Core/Upload/HTTPClient.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/Datadog/Core/Upload/HTTPClient.swift b/Sources/Datadog/Core/Upload/HTTPClient.swift index fb4598c3d0..8855c2ce25 100644 --- a/Sources/Datadog/Core/Upload/HTTPClient.swift +++ b/Sources/Datadog/Core/Upload/HTTPClient.swift @@ -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)) From 71df3d9cf067ff75e8f3508bbe2d785c615aeb0f Mon Sep 17 00:00:00 2001 From: Maciek Grzybowski Date: Wed, 15 Jul 2020 11:28:00 +0200 Subject: [PATCH 2/3] RUMM-611 Fix ASC submission issue by not embedding `Datadog.framework` inside `DatadogObjc.framework` --- Datadog/Datadog.xcodeproj/project.pbxproj | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Datadog/Datadog.xcodeproj/project.pbxproj b/Datadog/Datadog.xcodeproj/project.pbxproj index cc4ece532b..27641d6454 100644 --- a/Datadog/Datadog.xcodeproj/project.pbxproj +++ b/Datadog/Datadog.xcodeproj/project.pbxproj @@ -82,7 +82,6 @@ 61133C6D2423990D00786299 /* TestsDirectory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61133C462423990D00786299 /* TestsDirectory.swift */; }; 61133C6E2423990D00786299 /* DatadogExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61133C472423990D00786299 /* DatadogExtensions.swift */; }; 61133C702423993200786299 /* Datadog.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61133B82242393DE00786299 /* Datadog.framework */; }; - 61133C712423993200786299 /* Datadog.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 61133B82242393DE00786299 /* Datadog.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 612983CD2449E62E00D4424B /* LoggingFeature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 612983CC2449E62E00D4424B /* LoggingFeature.swift */; }; 61345613244756E300E7DA6B /* PerformancePresetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61345612244756E300E7DA6B /* PerformancePresetTests.swift */; }; 614E9EB3244719FA007EE3E1 /* BundleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 614E9EB2244719FA007EE3E1 /* BundleType.swift */; }; @@ -143,20 +142,6 @@ }; /* End PBXContainerItemProxy section */ -/* Begin PBXCopyFilesBuildPhase section */ - 61133C742423993200786299 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 61133C712423993200786299 /* Datadog.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ 61133B82242393DE00786299 /* Datadog.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Datadog.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 61133B85242393DE00786299 /* Datadog.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Datadog.h; sourceTree = ""; }; @@ -838,7 +823,6 @@ 61133BEC242397DA00786299 /* Sources */, 61133BED242397DA00786299 /* Frameworks */, 61133BEE242397DA00786299 /* Resources */, - 61133C742423993200786299 /* Embed Frameworks */, ); buildRules = ( ); From 98b11a23902dfe034b322379325022fea1b5fa34 Mon Sep 17 00:00:00 2001 From: Maciek Grzybowski Date: Wed, 15 Jul 2020 11:42:58 +0200 Subject: [PATCH 3/3] RUMM-610 RUMM-611 Bump patch version --- DatadogSDK.podspec | 2 +- DatadogSDKObjc.podspec | 2 +- Sources/Datadog/Datadog.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DatadogSDK.podspec b/DatadogSDK.podspec index 5e5a25beba..7f8b7c4f3f 100644 --- a/DatadogSDK.podspec +++ b/DatadogSDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "DatadogSDK" s.module_name = "Datadog" - s.version = "1.2.2" + s.version = "1.2.3" s.summary = "Official Datadog Swift SDK for iOS." s.homepage = "https://www.datadoghq.com" diff --git a/DatadogSDKObjc.podspec b/DatadogSDKObjc.podspec index 8f279bf9a3..c9ff8271e5 100644 --- a/DatadogSDKObjc.podspec +++ b/DatadogSDKObjc.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "DatadogSDKObjc" s.module_name = "DatadogObjc" - s.version = "1.2.2" + s.version = "1.2.3" s.summary = "Official Datadog Objective-C SDK for iOS." s.homepage = "https://www.datadoghq.com" diff --git a/Sources/Datadog/Datadog.swift b/Sources/Datadog/Datadog.swift index 0579636af6..f0560431a5 100644 --- a/Sources/Datadog/Datadog.swift +++ b/Sources/Datadog/Datadog.swift @@ -8,7 +8,7 @@ import Foundation /// SDK version associated with logs. /// Should be synced with SDK releases. -internal let sdkVersion = "1.2.2" +internal let sdkVersion = "1.2.3" /// Datadog SDK configuration object. public class Datadog {