Whonix-Workstation 14 - increase default RAM?

I found a detailed comparison between the different memory compression mechanisms in the kernel. They may or may not be able to help in our case.

More research is needed. Suggest a direction I should look in.

You don’t want to disable swap altogether as its counterprodctive. Try reducing its size instead among other things in these threads:

What is the minimum amount of RAM where KDE can run in a reasonable way? You could maybe decrease the default amount for the gatway so you have more for the workstation.

If the swap file gets used more it just means you are running out of RAM. Without swap the system should crash even faster.

HulaHoop:

You don’t want to disable swap altogether as its counterprodctive. Try reducing its size instead among other things in these threads:

linux - prevent system freeze/unresponsiveness due to swapping run away memory usage - Super User
oom - How do I prevent Linux from freezing when out of memory? - Server Fault

As soon as there is as little as 10 MB swap in use, system gets so slow,
that most will just hard reset. So something is wrong with it.

Algernon:

What is the minimum amount of RAM where KDE can run in a reasonable way? You could maybe decrease the default amount for the gatway so you have more for the workstation.

Will have to recheck but I think 768 MB is the minimum where the gateway
runs without swap. So not much to save there.

I just made some tests to lower the RAM consumption. 768 MB for the gateway indeed seems to be the minimum. With 512 MB it gets really slow and swap gets used.
On the workstation the clear winner regarding RAM consumption is plasma-shell (~20%) followed by kwin_x11 (10-15%) and krunner (8%).
Firefox + plugin container directly after boot consume ~ 40% (ca 300 MB) of the memory, which I’d consider normal.
There are also many socat instances running which are required, however, 30 of them also occupy ~ 10-15% RAM
I’m not that familiar with the KDE desktop so the following might produce unexpected results. krunner can be killed without any problems, also kactivitymanagerd, xmbedsniproxy (removes the sdwate icon in the taskbar)
This will give you maybe 15 % RAM back and using the browser with only one tab open does not show any swapping but this will likely change with more tabs. I couldn’t yet find a way to reduce the memory consumption of the plasmashell or kwin_x11.
Just an idea: The swap on the VM is slower than on the host due to overhead from the VM but might be even slower due to the encryption. Since there is only 1 CPU this might be an issue. Also zram will increase CPU consumption due to compression/decompression and many systems which are low in RAM have mostly also only a few CPU cores/lower frequency.

2 Likes

3 posts were merged into an existing topic: port anon-ws-disable-stacked-tor to systemd socket activation

Good stuff!


socat RAM waste should be sorted after the upgrade of anon-ws-disable-stacked-tor, which was just now uploaded to all stretch suites. (As long as 14 is testers-only, fast/risky package migration is a necessity.)

( port anon-ws-disable-stacked-tor to systemd socket activation )


krunner, all for getting rid of it. Was deactivated in Whonix 13 by package kde-lowfat. Got probably broken due to KDE upgrade of stretch. kde-lowfat was merged into anon-apps-config. Relevant files:

anon-apps-config/usr/share/anon-apps-config at master · Whonix/anon-apps-config · GitHub

Any idea how to get rid of it?


More stuff to work through from your post. :slight_smile:

1 Like

Another suggestion I see on forums is turning off desktop effects and the compositor. The thing about the compositor though is it might increase CPU load a bit since no GPU offloading is used - but I think this was always te case in VMs anyway?

Sounds ok. Why not.

At the moment RAM is the bottleneck and CPU is pretty idle? So I am not concerned about higher CPU. Also full RAM will lag the system beyond being usable. But CPU will catch up. So far the theory.

How do we turn them off using GUI for testing? They appear already not being enabled?

1 Like

System Settings > Hardware > Display and Monitor > Compositor

System Settings > Workspace > Desktop Behaviour > Desktop Effects

1 Like

After changing both of these, I got less free RAM.

Did this work for you to get more free RAM?

My observations: Disabling compositor freed up a couple hundered MB RAM. Desktop feels more responsive. Only downside is timesync icon is now surrounded by a blackbox.

I wonder how we have inconsistent results about RAM use.

1 Like

What did you use to check free RAM?

Whonix-Gateway… Konsole…

Compositor enabled.

  • Used: more RAM
  • Free: less RAM
              total        used        free      shared  buff/cache   available
Mem:            744         397          73          12         273         222
Swap:           509           0         509

Compositor disabled.

  • used: less RAM
  • free: less RAM
              total        used        free      shared  buff/cache   available
Mem:            744         353          67          12         324         266
Swap:           509           0         509

Strange?

Are your results similar?

Dynamic. They all create zram in relation to provided RAM.

Considering to fork any of them and then migrate GitHub - Kicksecure/swap-file-creator: Adds encrypted swap file to the system - for better protection of locally stored data and to aid environments with low RAM. https://www.kicksecure.com/wiki/swap-file-creator to zram.

1 Like

This seems newer and better maintained.

https://www.archlinux.org/packages/community/any/systemd-swap/

1 Like

OK I used free -m for more accuracy:

No compositor. free ram:

365

Compositor. free ram:

350

15 MB savings. Nothing great if you ask me. Its useful in my experience because everything seems snappy. However the taskbar icons become ugly to look at which I’m not sure how to fix.

Offtopic: For swap encrypted files, I suggest you shred the key rather than the entire encrypted swapfile. Its quicker and easier to do.

HulaHoop:

Offtopic: For swap encrypted files, I suggest you shred the key rather than the entire encrypted swapfile. Its quicker and easier to do.

If we use zram I was hoping to ditch swap files anyhow.

1 Like