Bug 362055 - System freezes when using up all Ram and Swap
Summary: System freezes when using up all Ram and Swap
Status: RESOLVED NOT A BUG
Alias: None
Product: neon
Classification: KDE Neon
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR crash
Target Milestone: ---
Assignee: Neon Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-21 23:28 UTC by Roman Gilg
Modified: 2016-04-22 19:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Gilg 2016-04-21 23:28:22 UTC
Neon dev stable.

On my laptop with 4GB ram, 2GB swap and slow hard drive compiling heavy stuff fills up all my ram and swap. Then the system hangs (display aswell as input devices). I observe something similar for multiple seconds after logging in following a boot and baloo file extractor kicking in.

Maybe we need a minimal free ram value as recommended here: http://askubuntu.com/questions/41778/computer-freezing-on-almost-full-ram-possibly-disk-cache-problem

Reproducible: Always
Comment 1 Harald Sitter 2016-04-22 08:40:09 UTC
I am not sure what that has to do with the default configuration I am afraid. I mean, you can certainly fine tune that for your system, but for general purpose I'd trust the defaults are useful.

If your RAM and your swap is full you are out of memory at which point you have reached maximum spawness regardless of your swapiness and under continued load the kernel will either be 100% IO waiting to swap/unswap events or attempt to shoot randomly in the crowd to OOM kill a process that matters (which, unless it is in make's parent group, won't happen). 
What you describe sounds more like RAM exhaustion leading to swapping leading to disk IO exhaustion leading to the system being sluggish to the point of perceived freeze. Since you also see it during baloo startup (at which point neither min_free_kbytes nor swapiness ought to matter) it definitely looks more like general IO exhaustion. Filing a bug against baloo would probably be a good first step of locking down the issue.

First please post the output of
`cat /sys/block/sda/queue/scheduler`
Comment 2 Harald Sitter 2016-04-22 08:42:36 UTC
Oh, and FWIW you should increase your swap to equal your RAM size. Also see Red Hat's fancy swap suggestions https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ch-swapspace.html#tb-recommended-system-swap-space

(Also if you find yourself in these memory exhaustion scenarios during building a lot you might want to consider upgrading your RAM, swap isn't really a substitute for RAM :/)
Comment 3 Roman Gilg 2016-04-22 12:26:54 UTC
I did already increase Swap size yesterday to 5GB and after that my compilation atleast got to an end (but slowly). Still baloo-file-extractor is filling up RAM for around 5-10 seconds after every boot after all other plasma components have loaded. But this is probably a problem of baloo and not Neon specific.
Comment 4 Roman Gilg 2016-04-22 19:28:36 UTC
Meanwhile I experienced the same problem on Netrunner Rolling. So it's definitely not an problem with Neon. Thanks for help Harald and will close here.