Closed svanimpe closed 6 years ago
@svanimpe I would expect SwiftMetrics to increase memory usage over a certain period of time when it starts, but it should level off at some point. We've certainly run SwiftMetricsDash with earlier versions of Swift for multiple days at a time although I haven't done that with Swift 4.1.x yet. If you keep it running do you see the usage level out after a while?
I've let it run for about half an hour and memory usage was already over 100MB. Given that my app only uses about 10MB on average and is only allocated 128MB, I don't consider this normal.
Yes, that does seem very high. What kind of system are you running on? Is it just a simple Kitura app that you're running?
I am running on macOS 10.13. When I deploy the same code to Bluemix (also using Swift 4.1), the memory usage stays fixed around 10MB, even after several hours, so this seems to be Mac-specific.
I've also tried doing a release build on Mac, but that had the same issue as the debug build.
My sample project shows completely flat memory usage using SwiftMetrics 2.3 with Swift 4.1.2 on Linux. I'll see if I or someone else can reproduce this on a Mac.
I have been able to reproduce the memory leak on Mac using SwiftMetrics 2.3 with Swift 4.1.2. However I am also seeing issues with the dashboard displaying multiple boxes for each metric in both Firefox and Safari:
@svanimpe - we have tracked down this memory leak today and we are planning to publish a fix in the next day or two. We think the bug is in the SwiftyJSON package as it relates to converting JSON objects to Strings, but we are coding a workaround in SwiftMetrics for the sake of expediency. cc @seabaylea @tobespc @neurosaurus
Fixed and now published in SwiftMetrics 2.4.0
When I include SwiftMetrics into my app as follows:
my memory usage increases by about 50KB/s.
I am using SwiftMetrics 2.3 with Swift 4.1.2.