Similar to this post Regular crash / freeze Ubuntu 16.04 LTS Unity, my main Xubuntu 16.04 LTS (xfce) on a PC -see spec below - with 2GB memory is crashing once a while. The PC runs Browser and office, standard Intel onboard graphics, nothing fancy. It runs fine for weeks, then happens a couple of days apart. Last year I had it at least 15 times, which I think is too much, because it has IMHO a high risk of data corruption.

I can see it coming, it always happened when I run TOR and Firefox in parallel. But when I see it its already too late to do something. Sometimes the mouse freezes shortly and I see that the memory indicator in the panel has jump up to 90%. Before I can do much, freezes intensify (often to more than 30 secs). The PC is so busy that its not possible to close any window, bring up any tool or even log into the console. I managed sometimes to switch between the CTRL-ALT-F1 and -F7, but the login would be so slow, that it times out before it even asks for the password. I have left it for hours but it never recovered. I have checked logs a few times, but could not get a hint from them. However, in that condition I would not trust the logs, since they too would be affected.

So far the only way to react is to hard reboot the PC, thus the risk of data loss.

I do not know what the root cause it. I can not reproduce it. Currently my working assumption is that the system is trapped in some caching loop. The other posts show me there similar issues out there. They try to find out what happened afterwards.

That is not what I want to do. I do not want to wait until it happens again and start posting tons of logs here. I rather would like to setup the PC that I can keep it alive when it will happen again and I can access a console to narrow down the issue. One could say I want help to help me myself.

So here is my specific question: Assuming I am seeing a memory caching issue caused by the 2 browsers in parallel, how can I configure/setup the system that its inner workings are protected.? In other words, that next time it happens, I have a working text mode console, after those 2 applications run havoc?

I am thinking along the lines that I could specify a max memory use to specific apps, so the app freezes, but not the system. Obviously I am looking for anything else that the work around to run the two apps in a VM.
I don't expect a step-by-step instruction, keywords or links to look for would help a lot.

Hope clear enough on what I need.

Thanks for you help.

PS: I would not expect that it is related to my specific Ubuntu flavor, Xubuntu.

Reference posts

PC Spec 4.4.0-87-generic #110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

~$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 2 Core(s) per socket: 1 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 28 Model name: Intel(R) Atom(TM) CPU D410 @ 1.66GHz Stepping: 10 CPU MHz: 1666.583 BogoMIPS: 3333.16 L1d cache: 24K L1i cache: 32K L2 cache: 512K NUMA node0 CPU(s): 0,1 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts nopl aperfmperf pni dtes64 monitor ds_cpl tm2 ssse3 cx16 xtpr pdcm movbe lahf_lm dtherm

  • How much swap space do you have? – heynnema Aug 1 '17 at 19:46
  • @heynnema Good point. Its 1GB, so it seems less than main memory. Didn't think to check that. Do you think that could be a reason for my observations? – CatMan Aug 3 '17 at 10:41

With 2G RAM, and 1G of swap, this behaviour would be expected. Increase your swap to 4G minimum, or do both... increase RAM AND increase swap.

You may also wish to investigate the vm.swappiness parameter, as you can tailor it to effect when/how swapping occurs. You'll find plenty of info here on AU, or via Google search.

  • Hey thanks a lot for that info. I'll have a look into that interesting topic and see if that actually was the root cause! – CatMan Aug 3 '17 at 19:20
  • Changed Answer as this seemed to have been the root cause. Thanks a lot! – CatMan Aug 15 '17 at 10:53

You might be able to use Control groups (cgroups) to limit memory usage. They are a Linux kernel feature that allow you to limit resource use (including memory) for processes, by placing processes in specific cgroups. There is some documentation on the Arch Linux website as well as on the Ubuntu server guide that may be helpful.

  • Perfect, that seems to be the feature I was hoping for! I looked at the server guide documentation which gives an impression but lacks examples. Those can be found with a search in this forum with the keyword 'Cgroups', e.g. askubuntu.com/questions/754071/… – CatMan Aug 1 '17 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.