public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-user] limit maximum memory size of any process
@ 2008-11-03 10:24 99% Zhang Weiwu
  0 siblings, 0 replies; 1+ results
From: Zhang Weiwu @ 2008-11-03 10:24 UTC (permalink / raw
  To: gentoo-user

Hello.

In my daily us of computer any process that takes more than 50% of the
memory (I read from top, not knowing if this is 50% of 384MB physical or
50% of having 800MB swap counted in) must have gone wrong, and usually
drag performance down to such extent that killing it is impossible
(because not possible to launch a terminal window to type kill -TERM).
Examples are:

   1. Firefox opens a broken website that wish to send 10M binary
      content to the browser window;
   2. OpenOffice opens a document incorrectly;
   3. Mistake in Java software (usually it keep eating memory);

I hope I can configure the system so that any process uses more than 50%
of memory are automatically killed. first I was recommend to use ulimit
by googling around. However this seems doesn't work even if I set both
-d and -m (here is my .xinitrc)

~$ cat .xinitrc
#export XMODIFIERS=@im=FCITX
#fcitx &
ulimit -d 300000
ulimit -m 300
exec /usr/bin/fluxbox


Result: OpenOffice stands still even when it takes 80% memory (read from
top).
So: is ulimit the solution? If so, what option should I set? My current
ulimit is:

$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) 300000
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 3072
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) 300
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 3072
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited


-- 
Real Softservice

Huateng Tower, Unit 1788
Jia 302 3rd area of Jinsong, Chao Yang

Tel: +86 (10) 8773 0650 ext 603
Mobile: 159 1111 7382
http://www.realss.com




^ permalink raw reply	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2008-11-03 10:24 99% [gentoo-user] limit maximum memory size of any process Zhang Weiwu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox