KlingonTarg Posted May 3, 2020 Share Posted May 3, 2020 Leaving Affinity Photo 1.8.3.641 on Windows 10 Pro (64-bit) running overnight (and not doing anything for many days) results in a roughly 300MB per day memory leak. After 10 days of just running in the background, Affinity used almost 3GB RAM according to Task Manager. I only had about a half-dozen SVGs open. When I closed Affinity down, it appeared to *allocate* an additional 3GB RAM while it was shutting down - reaching around 6.5GB RAM usage at peak. I have 32GB RAM, so it was able to cleanly shut down without hitting swap, but that's still kind of ridiculous. Probably some internal references not being released, so those resources are never freed until application shutdown. Most memory leak detection tools won't pick those kind of leaks up. Quote Link to comment Share on other sites More sharing options...
v_kyr Posted May 4, 2020 Share Posted May 4, 2020 21 minutes ago, KlingonTarg said: Probably some internal references not being released, so those resources are never freed until application shutdown. Most memory leak detection tools won't pick those kind of leaks up. Well it always depends on the tools, the way they work and how you use them in your development workflow and stress testing cycles etc. Basically there are a bunch of tools which can assist in this regard, also expecially for C++. - Just a few of them ... Top 20+ Memory Leak Detection Tools for Java, C++ on Linux and Windows However, there are sometimes also circumstances, where some memory leaks then are possibly inside reused third party code (libs, modules, frameworks) and thus inside foreign developed code. Such things are then sometimes harder to detect/find and also to fix, especiall if you don't may have the sources of the third party code or due to it's possible complexity. - As said it always depends. Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
KlingonTarg Posted May 4, 2020 Author Share Posted May 4, 2020 All leak detection tools detect memory leaks based on memory no longer being attached to something. Some tools let you measure between two segments of code if you instrument the code manually. If an object uses reference counting and it gets into a circular reference situation, it can become nearly impossible to free the object until the application closes AND memory leak detection tools generally won't detect it because it DOES get freed when the application exits. I'm saying there is a 300MB per day memory leak in Affinity Photo that needs to be tracked down. That's a pretty significant leak. Quote Link to comment Share on other sites More sharing options...
v_kyr Posted May 4, 2020 Share Posted May 4, 2020 In case of circular reference of occupied but no longer used and not freed mem (possible dangling pointers etc.) it's indeed always a bad thing to handle in graceful manner. If detected and narrowed down, such code would need some amount of code restructuring/refactoring to overcome at all. - I wonder that it needed (allocated) additional 3GB of RAM in your case to shut down at all. Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
KlingonTarg Posted May 4, 2020 Author Share Posted May 4, 2020 It's possible that the OS had shunted unused pages to disk and was just reloading them on exit to free up space. In which case, the bug would be more along the lines of 600MB per day (i.e. an even bigger leak). I'm just reporting what I saw in the hopes that the devs take a look at it. Quote Link to comment Share on other sites More sharing options...
Mark Ingram Posted May 11, 2020 Share Posted May 11, 2020 On 5/4/2020 at 12:48 AM, KlingonTarg said: Leaving Affinity Photo 1.8.3.641 on Windows 10 Pro (64-bit) running overnight (and not doing anything for many days) results in a roughly 300MB per day memory leak. After 10 days of just running in the background, Affinity used almost 3GB RAM according to Task Manager. I only had about a half-dozen SVGs open. When I closed Affinity down, it appeared to *allocate* an additional 3GB RAM while it was shutting down - reaching around 6.5GB RAM usage at peak. I have 32GB RAM, so it was able to cleanly shut down without hitting swap, but that's still kind of ridiculous. Probably some internal references not being released, so those resources are never freed until application shutdown. Most memory leak detection tools won't pick those kind of leaks up. It's a bit hard to comment without trying to reproduce that behaviour here first. However I will say that it is hard to diagnose whether the application is "leaking" by looking at task manager. We cache plenty of data, in RAM, and on disk, and we're aware of your system's RAM size so can throttle accordingly. 6.5GB out of 32GB doesn't seem that bad for peak usage either, but there's a possibility we're doing some extra work on shutdown that might cause a spike. We'll investigate and see if we can reproduce. Chris B 1 Quote Link to comment Share on other sites More sharing options...
TDawes Posted May 20, 2020 Share Posted May 20, 2020 I have had the same problem. Affinity 1.8.3.641 with Windows 10 Pro 16GB RAM. 1 image open, left overnight and system crashed with swap file full. This has happened before but now I'm sure that it is Affinity Photo as nothing else was running. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.