Memory Management

Hello

Having alot of issues with memory management when using Qubes. Always getting the error message regardin insufficient memory. What’s the best way to handle this?

Thank you

How many qubes are you running and how much RAM do you have? In the preferences for every qube, you can specify the maximum RAM it will be using.

Also, you can in principle assign specific fixed amount of RAM to every qube in the preferences to be sure every qube has enough.

I’ve never played around with this, but you can also install the package
qubes-app-shutdown-idle If you want qubes to automatically shutdown when idle.

1 Like

I have about 16 GB of RAM to work with but one of the Qubes has max memory set to 4GB. I can’t change it as its greyed out; not sure exactly which cli command will let me change the max memory. I tried one and it returned an error message regarding “static memory cannot be less than dynamic memory” I’m not sure if building templates using Qubes Builder would be better for managing limited memory. Dom0 is using ~2.5 GB so that’s quite a bit.

That must be because you unticked the “include in memory balance” option just bellow it, now? Are we talking here about a default template?

Yes it was a default template. The qmemman algorithm is described in the documentation but I’ve noticed lots of memory related issues. The documentation doesn’t state whether every single qube should be included (I would assume so) to get the benefit of the entire pool of available memory

…And when you attempt to add certain qubes to the pool; it gives an error message about “Dynamic memory balancing can result in some devices not working” so I’m hesitant to include them into the pool.

you’re right to be hesitant. Those warnings are there for a reason.
As to the rest you can restrict memory for dom0 by editing kernel
parameters - in grub.cfg set dom0_mem=max:1536M as a xen option.

Most of the system qubes can run with less than 400MB; change up
sys-firewall; restrict memory for most of your other qubes.
No doubt Qubes is memory intensive, but by working your system, you
should be able to run fine with 16GB

Thank you for your reply and all tho other replies. I have a question about the Qube manager gui with respect to memory and vCPU values. Does it require the qube to be restarted to reflect the updated values. What is the recommended vCPU value for an individual Qube? In particular if that Qube has higher resource requirements?

I dont believe you can hotplug RAM or CPUs, so you will need to restart the
qube.
Default value for vCPU is 2 - I have very occasionally changed this up,
but I’m not convinced it has made much difference in practice.
I do push it down for many qubes.

It does seem to make a difference as a % of total resource usage of the Qube (it’s reduced given increased vCPU cores); just wish I had more cores to play with :wink:

This link was very helpful Tuning Xen for Performance - Xen for tuning performance across different domains. adjusting the CPU credit scheduler for dom0 seems to free up CPU resources for use in the overall pool.

1 Like

Amazing link

Nice command :

xl vcpu-list

How do I dertermine the max vCPU available on my computer ?

Like can I give an AppVM 500 vCPU what will happen ?

How much do you give of vCPU to your Qubes ?

I just put to my 4 core no virtual core cpu to one Qube 44 vcpus. All was fine. Each got own thouse L1 L2 L3 caches. So it makes virtual cpu`s.
1 would make it one highway lane. So 2, 3, 4 could be normal performance.

1 Like