Comments (9)
hey @msanders truetime is still leaking quite abit.
This from memory debugger are all truetime related.
From Xcode 9, Swift 4, iOS 10 target.
from truetime.swift.
@otymartin: Thanks for reporting. Was having trouble reproducing but seeing a similar issue now when testing against recurrent timeouts / bad network conditions. Is this related to the scenario you were seeing this in?
from truetime.swift.
@otymartin: This should be fixed now on master and will be included in 4.1.4. Let me know if you run into anything else!
from truetime.swift.
@msanders
Excuse the late response. Dont know how to answer your question.
I reference TrueTime like this in all my scenarious where I may need to make a network call depended on server time eg. performing transactions. And right before using it, as a safety check I always use guard statement to check if now()
exists or fetchInNeed()
if now()
is nil.
Ill check the new master and report back with any other memory issues.
fileprivate var now: Date? {
return TrueTimeClient.sharedInstance.referenceTime?.now()
}
...
guard let now = self.now else {
TrueTimeClient.sharedInstance.fetchIfNeeded()
return
}
from truetime.swift.
This is a bit strange. I'm seeing the same behavior in my app, specifically running this causes 10 leaks according to xcode:
for i in (0..<10) {
TrueTimeClient.sharedInstance.fetchIfNeeded()
}
But I'm unable to reproduce the memory leak in the example project. Could there be a retain cycle in NTPConnection.swift's close
? This is calling lockQueue.async(execute: work)
, where work
has a strong reference to self
. Does the lockQueue
have a strong reference to the work closure (and we have a strong reference to lockQueue
)?
Specifying [self weak]
in the capture list for that closure "fixed" the issue in my project, but I'm unsure as to why I'm unable to reproduce it in the example project.
Additional reference, I'm using commit 8aadebabe2590d6ab295c390df5bbc109b346348
via cocoapods in my project.
from truetime.swift.
I faced the issue as @msanders reported
from truetime.swift.
The issue still happens.
from truetime.swift.
Have any idea to fix memory leak?
from truetime.swift.
Did anyone find a solution to this issue? Thanks in advance!
from truetime.swift.
Related Issues (20)
- Crashed: com.instacart.ntp.connection HOT 3
- Connection Timed out Error
- Crash on retain cycle
- Xcode 14.0.1 (M1 Mac) carthage update --platform ios --use-xcframeworks" not working
- 5.1.0 version is not published on cocoapods
- Xcode 14.3 compatibility needed to resolve error: libarclite_iphonesimulator.a file not found HOT 6
- Xcode 15: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.10, but the range of supported deployment target versions is 10.13 to 14.0.99.
- DEBUG_LOGGING
- Getting Reference Time into UserDefaults error
- precondition(self.reachability.callback == nil, "Already started")
- Could not find module 'TrueTime' for target 'arm64-apple-ios'; found: x86_64, x86_64-apple-macos
- While running testcases, precondition get failed precondition(self.reachability.callback != nil, "Must start client before retrieving time")
- Crashed: com.instacart.ntp.client @objc closure #1 in variable initialization expression of HostResolver.hostCallback + 64 HOT 2
- Can not import TrueTime library to my Kotlin/Multiplatform (iOS) project HOT 1
- I am blocking the main thread and waiting sync till TrueTime responds. But it blocks forever! HOT 1
- Huge Amounts Of memory Leaks reported in XCode HOT 2
- TrueTime inside SDK HOT 3
- CocoaPods Master Repo is still on TrueTime 5.0.3 HOT 1
- Crashlytics: Crashed: com.instacart.ntp.client HOT 2
- Can't build with Carthage on M1 Mac HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from truetime.swift.