Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cgroups to limit memory (e.g. prevent swap freezes)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
jhon987
Apprentice
Apprentice


Joined: 18 Nov 2013
Posts: 297

PostPosted: Wed Jan 10, 2018 11:02 pm    Post subject: cgroups to limit memory (e.g. prevent swap freezes) Reply with quote

So I read that one could use cgroups in order to avoid system freezes due to swapping run away memory usage (https://superuser.com/questions/1115983/prevent-system-freeze-unresponsiveness-due-to-swapping-run-away-memory-usage) - is that true?

If so, can someone please explain how to apply it on Gentoo because the example in the guide (https://wiki.gentoo.org/wiki/OpenRC/CGroups) is a bit unclear to me.
On my case, freezes occur upon emerging large packages: chromium, clang, etc... According to TOP the process that hogs all the RAM is cc1plus,
so had I wanted to avoid swap and freeze what values should I be inserting here:
rc_cgroup_${CONTROLLER_NAME}="${CONTROLLER_NAME}.${OPTION_NAME} ${OPTION VALUE}"

Would this be OK:
rc_cgroup_memory="memory.max 8132972 pids.max max" (note the memory units I used is KiB should I use bytes?)

Or, am I completely off track?
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5934

PostPosted: Wed Jan 10, 2018 11:31 pm    Post subject: Reply with quote

I've never used the memory controller myself, but maybe these could help...

https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
https://www.kernel.org/doc/Documentation/cgroup-v2.txt
Back to top
View user's profile Send private message
jhon987
Apprentice
Apprentice


Joined: 18 Nov 2013
Posts: 297

PostPosted: Thu Jan 11, 2018 10:28 am    Post subject: Reply with quote

Yeah, tnx.
I bumped into that documentation, but was hoping someone could shorten things for me, I guess not...

Well, time to dig into that ugly doc, man, it look so windows 93 style with that grey background.

Still, any straightforward answers would be appreciated (i.e. answers that don't redirect me to another resource).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum