System grinds to a halt when memory runs out

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

System grinds to a halt when memory runs out

Post by raboof »

I sometimes try to run more memory-intensive applications than my system can handle.

Of course, there is no easy way out: some memory-hungry application will have to go. That is what the OOM killer is designed to accomplish.

However, what I notice is that sometimes, my system first grinds to a halt (even moving the mouse barely works, let alone actually switching windows and killing offending processes - this lasts for minutes).

I have already turned off swap (as I prefer killing the offending process over introducing lots of I/O due to swapping). I don't want to disable memory overcommit, as it is a useful approach.

What can I do make sure the OOM killer kicks in before my system becomes unresponsive, and/or 'reserve' some resources to make sure my mouse and xterms remain functional even when the rest of the system is getting overloaded?

I guess to get at the root of the problem, it would be good to first explain what the system is so busy with. Sure, you can expect some slowdown because in low-memory situations there won't be as much room for disk cache and similar optimizations, but that doesn't feel like it explains the whole system becoming unresponsive. I guess the first step will be to create some test programs to reliably reproduce the problem.

Any ideas?
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: System grinds to a halt when memory runs out

Post by CrocoDuck »

raboof wrote:I guess the first step will be to create some test programs to reliably reproduce the problem.
About this, I think the stress command does the job for you. For example, in the past I used this:

Code: Select all

stress --cpu 4 --io 4 --vm 4 --vm-bytes 2048M
What it does is noted down in this review on my blog.
User avatar
AlexTheBassist
Established Member
Posts: 353
Joined: Mon May 19, 2014 3:44 am
Location: Russia, Moscow
Been thanked: 1 time

Re: System grinds to a halt when memory runs out

Post by AlexTheBassist »

Just change swappiness kernel parameter to something that will fit your workflow. It's not Windows, you actually can do that.
Being creative does not imply being lazy, stupid, or illiterate.

Working in Harrison Mixbus and Ardour on KDE Neon + KXStudio.
Post Reply