Hi! What’s not quite right with Roon?
· None of the above quite fits
None of the above quite fits
· None of these quite match
Tell us what's going on
· The Roon client on my Mac leaks memory. It retains about 33 MB of managed heap each time it reconnects to the server, and each reconnect also reloads the home screen. The memory is only released by restarting Roon.
The Mac's normal sleep and dark wake cycles drop the connection, so the leak grows even when nobody is using Roon. In the latest run, managed-live memory in the [stats] log lines went from 97 MB to 7,707 MB in 47.5 hours, and the process footprint reached 11 GB.
Versions: client 2.74 (build 1716), server 2.74 (build 1717) earlyaccess, macOS 27.2, Apple M4 Max with 64 GB RAM. The leak is not new in 2.74. I see it in every build I have logs for: 1696, 1700, 1712 and 1716.
Evidence:
- 224 reconnects and 347 home screen loads in the run. 341 of those loads came within 5 seconds of a reconnect.
- Growth tracks reconnects closely (r = 0.99). The 11 roughly hour-long stretches with no home screen load grew by 3.3 MB on average.
- 218 of 223 reconnects came within 90 seconds of a Mac wake event in pmset -g log, against about 22% by chance.
- For 10 hours when the Mac stayed awake there was one reconnect and memory grew by 184 MB. About 163 MB of that came in one step while I was viewing an album gallery, with no reconnect, so the leak may be UI content in general.
- A dotnet-gcdump forced a full garbage collection and managed-live stayed at about 7,700 MB, so this memory is really retained.
- The dump is partial, covering 977 MB of the 7.7 GB heap. Most of it is UI objects: Broo.Engine.LabelWidget, ImageWidget, StackPanel, RenNode and DynamicImageWidget, plus Broo.Runtime.Equation. Tables of Roon.Broker.Remoting.TypeDescriptor also appear about 30 times, which may mean one retained copy per reconnect, though I have no dump from a fresh client to compare with.
I can't tell from this whether the reconnect or the home screen reload is the cause, what is holding these objects, or whether the 3.7 GB of GPU memory in the process is also leaking.
I have a scrubbed log excerpt and the heap dump available if they would help.
Tell us about your home network
· The Mac is on WiFi. The Roon server is running in a container.
Hey @Anders_Wallgren,
Thanks for such a thorough write-up. Your measurements line up with what we see in your Roon Server logs. Nearly every reconnect from your MacBook Pro comes after the server has dropped the sleeping session, so the app starts a fresh session and rebuilds Home. The server itself releases everything cleanly. This matches a client-side issue our team is already working on, where the app keeps the previous connection in memory after a reconnect.
To confirm it’s the same issue, could you check whether your heap dump shows RemotingClientV2 and byte objects of exactly 16,777,240 bytes growing by roughly one per reconnect? It would also help to have your Mac’s Roon logs: zip ~/Library/Roon/Logs after a few sleep/wake cycles and send us the link. Until a fix ships, quitting Roon before the Mac sleeps, or turning off “Wake for network access”, will keep the growth down.
Thanks, that matches what I see.
I went through the heap dump directly. It has 37 instances of Roon.Broker.Remoting.RemotingClientV2, each with its own DistributedBroker, RemotingClientContext and pending-request table. The client had reconnected 225 times when I took it, and the dump only captured 977 MB of the 7.7 GB heap because it hit the 10 million object limit, so that fits roughly one retained session per reconnect.
About 30 of the old clients are each referenced by 10,000 to 12,000 objects, mostly API proxies: Roon_Broker_Api_Image_Proxy, AlbumLite_Proxy, PerformerLite_Proxy, DataList and TagLite. Three clients also hold between hundreds and about 11,000 pending ResponseCallback closures. I only traced two levels of references, so I don’t know what holds the proxies.
I found no byte arrays of exactly 16,777,240 bytes. The dump has no objects of 1 MB or more at all, which suggests it missed the large object heap, so I wouldn’t read anything into that. Each retained client does hold one 32,792-byte buffer.
Logs are available here: Microsoft OneDrive. They cover the whole leaking run, from 10/30 to 11/01, with about 244 sleep/wake reconnects. I still have the dump file if you want it.
Until the fix ships, I’ll quit Roon before the Mac sleeps.
Thanks for the detailed write-up, @Anders_Wallgren. Your logs back it up. For the 10/30–11/01 run we get the same numbers you did: managed-live went from 97 MB to about 7.7 GB at the 47.5-hour mark, with 224 reconnects and 347 Home loads, 341 of them within 5 seconds of a reconnect. That works out to about 33 MB kept per reconnect.
One correction to our earlier reply: the logs don’t show the server ending the session. In most cases the Roon app on your Mac times out the connection while the Mac sleeps, then reconnects on wake. The effect is the same, but the drop starts on the Mac side.
Your finding from the time the Mac was awake also holds up. On 10/31, browsing album pages at about 16:12 added about 160 MB without any reconnect. That suggests the rebuilt screens keep the old session’s objects alive, which fits the 37 RemotingClientV2 instances in your dump better than one leaked session per reconnect.
We’ve passed this to the team working on the fix. Please keep the heap dump in case they need it. Until the fix ships, quitting Roon before the Mac sleeps is still the best workaround.