Handling Memory Leaks in Long-Running Applications

Hello

I’ve been working on a long-running application & noticed that over time; memory usage keeps increasing, even when no additional data is being processed. This suggests a possible memory leak, but I’m having trouble pinpointing the exact cause. :innocent:

The issue persists across different environments & I’ve ruled out obvious culprits like unclosed file handles or excessive object retention. :slightly_smiling_face:

I’ve tried using profiling tools to track memory allocation and deallocation; but the results aren’t conclusive. Are there any best practices or tools that you recommend for efficiently identifying and fixing memory leaks in applications that need to run continuously for extended periods? :upside_down_face: Additionally, I’m curious if garbage collection settings or manual memory management techniques could help mitigate this issue. I checked https://learn.microsoft.com/en-us/windows/win32/win7appqual/preventing-memory-leaks-in-windows-applications-Java Certification course online resources, and found it quite informative.

Would love to hear from others who have dealt with similar problems and how you tackled them! Any advice on debugging strategies or code review practices to catch leaks early would also be helpful. :slightly_smiling_face:

Thank you !! :blush:

Depends on the used programming language and libraries. There is no “fits for all” way but for every language/Library compination individual way. As the most of my Apps are Java applications I have a few shich are lont ime runners. But I have no problems like this. I had problems like this with every single Xojo application. That shows that it depends extremely on the language it runs on. As far as I know.

How much is the app leaking per hour?

If it is just a few MB, I wouldn’t care.

All OS have libraries which leak memory, e.g. by allocating an object and keeping it around forever.