Parrot os freeze

parrot os suddenly stuck, freeze screen, pointer don’t move, all in desktop/screen got stuck/freeze

AMD Ryzen 3 3200U with Radeon Vega Mobile Gfx 2.60 GHz
ram 4gb

i use virtualbox and i give the parrot os 2 ram

i hope someone can help,I have had this problem for a long time
Please speak English ‘simply’ because I am not good at it

2gb ram is kinda low practically and it also depends on the processes that you are running.
Mate might be the preffered DE for low specs
But still I would rather prefer dualbooting on your hardware which has 4gb ram, instead of virtualbox with 2gb ram out of 4gb

To fix this problem I have found that you need to set the following setting to something around 5%-6% of your total physical RAM, divided by the number of cores in the computer:

sysctl -w vm.min_free_kbytes=65536

Keep in mind that this is a per-core setting, so if I have 2GB RAM and two Cores, then I calculated 6% of only 1 GB and added a little extra just to be safe.

This forces the computer to try to keep this amount of RAM free, and in doing so limits the ability to cache disk files. Of course it still tries to cache them and immediately swap them out, so you should probably limit your swapping as well:

sysctl -w vm.swappiness=5 (100 = swap as often as possible, 0= swap only on total necessity)

The result is that linux no longer randomly decides to load a whole movie file of approx 1GB in ram while watching it, and killing the machine in doing so.

Now there is enough reserved space to avoid memory starvation, which aparrently was the problem (seeing as there are no more freezes like before).
After testing for a day - lockups are gone, sometimes there are minor slowdowns, because stuff gets cached more often, but I can live with that if I dont have to restart computer every few hours.

The lesson here is - default memory management is just one of use cases and is not allways the best, even though some people try to suggest otherwise - home entertainment ubuntu should be configured differently than server.

You probably want to make these settings permanent by adding them to your /etc/sysctl.conf like this: vm.swappiness=5

vm.min_free_kbytes=65536