Memory leak MacOS

I flashed a couple of SDs two days ago. I just noticed my machine was getting sluggish and when I checked memory Etcher was using 8.5GB.

Hi Rob, interesting, I use Etcher nearly every day but mostly close the application once I am done flashing. I will try leaving it open for a few days and see what happens, though. Can you let us know what version of Etcher you are using (click gear at top-right), and, what version of MacOS you are on please?

I’m using MacOS 11.5.2, and the Etcher 1.5.121. I think I burned two 32GB cards. I should have thought to use Xcode profiler to see if there were any hints about where the leak was!

Thanks for the detail. I will try to duplicate it…but if you happen to burn any more SD Cards, see what happens on your side as well. :slight_smile:

I sure will! I’ve used the tool a bunch of the last few years - thanks for putting out there for free use!

1 Like

Awesome! Not sure exactly how expert you at tracing down a memory leak, but if you do witness it again and use Xcode, keep in mind that Etcher is open source…you can always PR in a fix if it’s something you pinpoint and know how to resolve! (We will of course try to duplicate and pinpoint it, as well.). :slight_smile:

Unfortunately can’t use Instruments to try to find the memory leak without restarting the app. But it did happen to me again, I believe over the course of about 24 hours but maybe more. I burned one SD. Here are the relevant screenshots. Hope they help track it down!

Screen Shot 2021-09-14 at 8.10.01 PM

Screen Shot 2021-09-14 at 8.10.12 PM

Hi, so I work on the Etcher team, and I was unable to replicate your results.

Would you mind doing some diagnostics for us?

If you can open Etcher and press CMD+ALT+I, click on “Memory”, select “Allocation sampling”, and click “Start”.

Then just leave it on in the background until you see that the process is taking up too much memory and post the results.

Particularly if you can find the line that is taking up too much memory, click “Pretty-print” and post a screenshot, we can narrow down the exact line of code which is allocating too much memory.

This would be extremely helpful in locating the bug.

Thank you.

I can confirm that after leaving it open for a couple days after flashing a Raspberry Pi and leaving it on with the image selected my RAM usage creeped up to over 8GB as well. This is on an M2 Mac.

                     ..'          dax@PorterMac-2
                 ,xNMM.           ---------------
               .OMMMMo            OS: macOS Sonoma 14.4.1 23E224 arm64
               lMM"               Host: MacBook Air (M2, 2022)
     .;loddo:.  .olloddol;.       Kernel: 23.4.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:     Uptime: 2 days, 4 hours
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.     Packages: 468 (brew), 133 (brew-cask)
 XMMMMMMMMMMMMMMMMMMMMMMMX.       Shell: zsh 5.9
;MMMMMMMMMMMMMMMMMMMMMMMM:        Display (Color LCD): 2940x1912 @ 60Hz (as 1470x956) [Built-in]
:MMMMMMMMMMMMMMMMMMMMMMMM:        DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.       WM: Quartz Compositor
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.     WM Theme: Orange (Dark)
 'XMMMMMMMMMMMMMMMMMMMMMMMMMMk    Font: .AppleSystemUIFont [System], Helvetica [User]
  'XMMMMMMMMMMMMMMMMMMMMMMMMK.    Cursor: Fill - Black, Outline - White (32px)
    kMMMMMMMMMMMMMMMMMMMMMMd      Terminal: Warp v0.2024.04.30.08.02.stable_01
     ;KMMMMMMMWXXWMMMMMMMk.       Terminal Font: Hack (14.0pt)
       "cooc*"    "*coo'"         CPU: Apple M2 (8) @ 3.50 GHz
                                  GPU: Apple M2 (10) [Integrated]
                                  Memory: 19.33 GiB / 24.00 GiB (81%)
                                  Swap: 3.00 GiB / 4.00 GiB (75%)
                                  Disk (/): 1.65 TiB / 1.81 TiB (91%) - apfs [Read-only]
                                  Local IP (en0): 192.168.4.39/22 *
                                  Battery: 100% [Discharging]
                                  Locale: en_US.UTF-8

                               ```
as you can see the ram usage is quite high and both Activity monitor and gtop show it being balenaEtcher.