memory management in dom0 ?

256 views
Skip to first unread message

Tom Zander

unread,
Jan 11, 2018, 8:45:40 AM1/11/18
to qubes-users
I understand that there is a memory-manager to balance the memory between VM
spaces.
Does anyone know if dom0 is being managed this way?

Currently there is 4GB assigned to dom0, of which 1.3 GB is in use.
At the same time I have chromium getting out-of-memory errors in an AppVM.
I'd like to actually use that 2½GB that dom0 now claims but doesn't use,
anyone got ideas how?

Thanks!
--
Tom Zander
Blog: https://zander.github.io
Vlog: https://vimeo.com/channels/tomscryptochannel


Vít Šesták

unread,
Jan 11, 2018, 9:07:57 AM1/11/18
to qubes-users
Yes, there is qmemman. I hope this is relatively up-to-date: https://www.qubes-os.org/doc/qmemman/ .

It should manage dom0 memory as well. By default, it assigns 1 GiB – 4 GiB of RAM to dom0.

For your case, I have few questions:

* What's dom0 swap usage? Qmemman includes this amount in memory requirements.
* Where does your “1.3 GB is in use” claim come from?
* How much of memory does the AppVM use? What is the memory limit for the AppVM? See VM settings » Advanced » Initial memory.

Regards,
Vít Šesták 'v6ak'

Chris Laprise

unread,
Jan 11, 2018, 10:25:02 AM1/11/18
to Tom Zander, qubes-users
On 01/11/2018 08:45 AM, 'Tom Zander' via qubes-users wrote:
> I understand that there is a memory-manager to balance the memory between VM
> spaces.
> Does anyone know if dom0 is being managed this way?
>
> Currently there is 4GB assigned to dom0, of which 1.3 GB is in use.
> At the same time I have chromium getting out-of-memory errors in an AppVM.
> I'd like to actually use that 2½GB that dom0 now claims but doesn't use,
> anyone got ideas how?
>
> Thanks!

There is a memory balancing bug in the R4 pre-release:

https://github.com/QubesOS/qubes-issues/issues/created_by/tasket

A workaround is to restart the qubes-qmemman.service periodically
(sometimes I need to do this every 5min or so).

I have also restricted dom0's max memory to help the situation. The
permanent setting for this is 'dom0_mem=max:' in /etc/default/grub,
which propagates to /boot/grub2/grub.cfg on the lines beginning with
'multiboot /xen'. Its currently at 1800M on this system and can probably
go lower.

--

Chris Laprise, tas...@posteo.net
https://github.com/tasket
https://twitter.com/ttaskett
PGP: BEE2 20C5 356E 764A 73EB 4AB3 1DC4 D106 F07F 1886

Tom Zander

unread,
Jan 11, 2018, 10:33:47 AM1/11/18
to qubes...@googlegroups.com, Vít Šesták
On Thursday, 11 January 2018 14:07:57 GMT Vít Šesták wrote:
> For your case, I have few questions:
>
> * What's dom0 swap usage? Qmemman includes this amount in memory
> requirements.

My dom0 has no swap, I didn't disable it, it just never had any.
I guess thats because in the installer I didn't assign any swap partition.

> * Where does your “1.3 GB is in use” claim come from?

Top :)
The "in use" is what top claims. Add the "buff/cache" amount (1MB) to it and
the "free" amount (1.6MB) and I do get to the total reported in both top and
xentop.

> * How much of memory does the AppVM use?

I looked at it at the time I got repeated crashes, it had some 800MB
assigned to it.

> What is the memory limit for the
> AppVM? See VM settings » Advanced » Initial memory.
The settings are 1GB initial and 4GB max.

I "solved" it by closing some VMs and my chromium got more space assigned.

-----

The qmemman has some more room for growth.
For instance I have one "Work" VM where I compile C++ code. I assigned it
16GB of memory and then qmemman came and only gave me 2GB.
I start a compile (8 cores times 0.6GB of mem used) and maybe 10 seconds
later I get out-of-memory issues.
To my annoyance xentop shows me that there is still >10 GB free,
unallocated. For some reason it just doesn't seem to allow growth of memory
fast enough, regardless of my settings.
I "solved" that by turning off memory management for that VM and just
setting it to 12GB always :(

Vít Šesták

unread,
Jan 13, 2018, 6:35:38 AM1/13/18
to qubes-users
> My dom0 has no swap, I didn't disable it, it just never had any.
> I guess thats because in the installer I didn't assign any swap partition.

Not optimal IMHO, but it simplifies this case.

> > * How much of memory does the AppVM use?
>
> I looked at it at the time I got repeated crashes, it had some 800MB
> assigned to it.
>
> > What is the memory limit for the
> > AppVM? See VM settings » Advanced » Initial memory.
> The settings are 1GB initial and 4GB max.
>
> I "solved" it by closing some VMs and my chromium got more space assigned.

This looks like it should not have behaved this way.

> I start a compile (8 cores times 0.6GB of mem used) and maybe 10 seconds
> later I get out-of-memory issues.
> To my annoyance xentop shows me that there is still >10 GB free,
> unallocated.

Again, it should not behave this way, Qmemman polls in 0.1s and tries to give the VM 130 % of its requirements. And all the VMs have 1GiB of swap space, unless you have made something custom. So, even if it was not fast enough, it should be temporarily covered by swap.

What is the status of qubes-qmemman.service? Do those issues persist after Qmemman restart or even after system reboot?

Regards,
Vít Šesták 'v6ak'
Reply all
Reply to author
Forward
0 new messages