question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memory leak in master branch (automation related?)

See original GitHub issue

Describe the bug The latest master branch (tested 0.10.999-cibuild0020870-beta https://github.com/AvaloniaUI/Avalonia/commit/cea6bc27a06f25b4f2d3a73d3411e904b1767e74) has a memory leak, probably related to Automation code.

Note: this is a regression from the current stable 0.10.x version (which doesn’t have automation related modules).

To Reproduce The repro is very simple - just add a button, press it and the button will not be freed anymore.

  1. Clone the repo: https://github.com/BAndysc/AvaloniaMenuLeak
  2. Checkout branch leak2
  3. Run the app
  4. The top text shows managed used memory, in the beginning it is less than 3 MBs
  5. Press the button Add control
  6. This will spawn a control, that has a reference to 1GB byte array, so obviously the ram usage will rise up to 1 GB
  7. Press Remove Control
  8. GC will free the control and datacontext almost instantly, and it will go down to 3 MBs, so far so good.
  9. Press Add control again
  10. This time click the button ‘Click me’
  11. Press Remove control
  12. Notice this time the memory usage doesn’t drop. The control is not freed!

Screenshots dotMemory screenshot: image

Desktop:

  • OS: Mac
  • Version: 0.10.999-cibuild0020870-beta (it works fine on 0.10.14)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
maxkatz6commented, Jun 3, 2022

Yeah, reproduced using Accessibility Insights to trigger automation. Got three weak references that live after button was detached: image

1reaction
BAndysccommented, Jun 1, 2022

Pretty weird, I used dotMemory as well to fix previous memory leak, and I used latest master (well, couple of days old now). And there was only one memory leak with old sample code.

if you mean my sample code, then the previous one (menu related) didn’t have this button, I’ve discovered it accidentally, while trying to reproduce another leak

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Memory leak in master ProcessManager #60049
We updated our infrastructure from 3002.6 to 3003 and observed a rather severe memory leak in the ProcessManager of the salt master.
Read more >
Best Practices For Automation Tester to Avoid Java ...
A memory leak is a type of issue that will not cause any problem unless Java Heap Memory is overflown, but once you...
Read more >
Finding Memory Leaks in Mobile Apps (Part 2: Automation)
First and foremost, we needed to build automated flows to constantly monitor and prevent new memory leaks and eliminate the existing ones as ......
Read more >
Memory leak when using UI Automation in Windows 10
I'm experiencing a memory leak on Windows 10 machine and after investigation of some dump taken from the process causing the issue (a...
Read more >
TFS Build - MSBuild 14 x64 memory leak or too high ...
Looks like it's a known bug which was fixed in the master branch of the MSBuild on the github.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found