Roon server on Linux consuming huge amount memory even when not in use

You can see here that RoonAppliance consumes between 70% to 78% of 16GB total RAM depending on activity. When the screenshot was taken no Roon appliance was opened and therefore not playing media. It looks to be holding a boat load of cache in memory.

I am running Roon on a Manjaro (+/- Arch Linux) based home server + router using the systemd-networkd network ecosystem. The screenshot shows the system parameters. So both the Roon server and ARC work well and the machine works well as both a server and router. The Roon server was installed via Roon’s installation script and updates without issue. Current version 2.0 build 1311

Is this huge memory consumption by design or is there a leak? If by design, is there a way to adjust the % of RAM Roon server is allowed to take?

Thanks,
Wes

1 Like

If you search the forum for memory consumption linux you will find a bunch of existing threads, maybe there is something helpful there

I searched before I posted this and did not find anything on ‘memory’. I did find the same topic when looking through the forum. My apologies about the redundancy.

How big is your library and is it doing any Audio Analysis?

Thanks for asking:
Use Qobuz almost exclusively nowadays. Looking at Roon it says I have 8667 tracks in storage
Not using any filters, EQ, etc

If I exclude my server library will that reduce Roon’s overall footprint?

I am reading that Roon does not need much CPU, lots of cores, etc. Just yesterday when I looked again Roon appliance was using 80% of CPU and total CPU use was fluctuating around 64%. CPU fan going 2x normal speed. I rebooted it but should have screen grabbed first.

I’m going to try disabling my local storage and see what happens. Thanks


Very high CPU use as well as RAM. CPU use does vary. For 1 or 2 minutes on end it was looking like the above. Disabling my stored library made no difference

A bit of a breakthrough here. I played with Nice settings in systemd roonserver.service using 10, 14, and 19 (maximum). It was only when set to 19 that differences started to be noticeable. The CPU spikes are now normal short bursts and while RoonAppliance is still a RAM hog, it is to a lesser degree and will actually give RAM back instead of it continually using it up. I haven’t touched IPv6 network settings at all.

Then the unexpected. So I’ve also had the UI freezing issues that have been reported in the forums here where it might take up to 10 seconds for Roon to wake up if you want to change what’s playing or cue something up. That issue appears to be gone now after using for a few days. Additionally, I haven’t measured it but I believe Roon is generally quicker and more responsive now. It’s almost as if Roon had been stealing resources from itself all along. It turns out a Nice Roon is a quicker Roon!

This reply was copied from the other RAM related thread. I know it’s redundant but I thought welcome news

2 Likes

Can you give me the terminal command to edit the service. I’m pretty sure once I’m there I remember how to adjust this, but it’s been a while and I can’t remember the command/location and I don’t see it in /usr/lib/systemd/system/.

I appreciate you taking the time to share this with the community!

Okay, I’ve done the changes above and have good results in CPU usage as well. Roon’s RAM usage tends to balloon overtime, so time will tell if it is more willing to share it’s RAM hogging. These are very short term results, and completely anecdotal evidence.

Do the following at your own discretion. I am no expert and I have multiple of backups of roon, my OS, and my files. I’m fully prepared for a catastrophic event from any changes/mistakes that could happen. For anyone still willing to make the changes, here’s how to do it. I’m using Ubuntu:

  • The service is located at /etc/systemd/system/roonserver.service
  • I use nano, so my command was sudo nano /etc/systemd/system/roonserver.service
  • Just add Nice=xx to the bottom of the [Service] list (the xx will be the priority level you desire, I used 10).

It should look similar to this:

[Unit]
Description=RoonServer
After=network-online.target

[Service]
Type=simple
User=root
Environment=ROON_DATAROOT=/var/roon
Environment=ROON_ID_DIR=/var/roon
ExecStart=/opt/RoonServer/start.sh
Restart=on-abort
Nice=10

[Install]
WantedBy=multi-user.target

Hopefully this gives you great results, or at least no ill effects! Just delete the Nice=xx if you wish to revert the changes.

I did not wait long enough to see how 10 or 14 would actually perform. When the RAM went above 30% I tried higher levels. Currently on my system at Nice=19, RAM varies roughly between 25% and 15%.

Alas, after 3 days of running with Nice set to 19. Stacking up memory again but still better with CPU use.

I’ve added memory limits to roonserver.service to improve things more. See related thread:

I upgraded to the most recent stable kernel 6.6 based Arch kernel because I was curious about the new EEVDF scheduler which replaced CFS. In the week after the switch the server crashed 4x with RoonAppliance hogging big time. I tried without Nice or MEM tweaks and it got there faster. So back on 6.5 since about 4 days and doing well again. Don’t know if the new scheduler is at fault but for now I’m sticking to 6.5 until Roon fixes this

Replying to myself here as a sort of journal that may be helpful to others. So I’m running on 6.5.12 kernel now but for some reason CPU use starting becoming more of a thing than memory use. It’s possible that newest behavior could be due to updates of other packages. For for about 10 days I’ve added the following parameters. It’s mostly OK now. A little bit of latency has crept back in again but good for now. Any chance that testing version could be headed our way? Only hoping.

Nice=10
MemoryMax=50%
MemoryHigh=40%
CPUQuota=85%
CPUWeight=30

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.