Gentoo Archives: gentoo-user

From: Matthias Bethke <matthias@×××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] limit maximum memory size of any process
Date: Tue, 04 Nov 2008 18:02:47
Message-Id: 20081104180240.GB9956@aldous
In Reply to: Re: [gentoo-user] limit maximum memory size of any process by Zhang Weiwu
1 Hi Zhang,
2 on Tue, Nov 04, 2008 at 03:30:55PM +0800, you wrote:
3 > > I interpret the above as "use a maximum of 300,000 KiB of memory, of
4 > > which 300 may be resident (i.e. in physical memory) and 299,700 swapped
5 > > out." That doesn't sound good, although I'm not sure I'm reading it
6 > > correctly.
7 >
8 > Sorry, it seems I used these parameter without care. I guess I only need
9 > to set physical memory limit, a.k.a. resident memory.
10
11 Yes, that sounds reasonable. Remember it's in kilobytes so that would be
12 300000.
13
14 > OT: I don't know why I have
15 > max locked memory (kbytes, -l) 32
16 > But it has been like that before I set ulimit.
17
18 "Locked memory" is memory that a process has protected against being
19 swapped to disk. The best-known example is the memory gpg uses to store
20 keys and passphrases, it would be pretty bad if it got swapped and
21 someone could find your unprotected key on the disk later, so gpg tries
22 to lock this memory in RAM.
23
24 > I don't have a file called /etc/sercurity/limits.conf and neither can I
25 > find information about it by using 'man limits.conf'. Further I couldn't
26 > find a package called pam_limits to emerge. Can you give me some clue which
27 > package I should emerge in order to set limits.conf ?
28
29 The pam_limits module is part of the standard PAM distribution, here
30 it's sys-libs/pam-1.0.1. Maybe just re-emerge it?
31
32 cheers,
33 Matthias
34 --
35 I prefer encrypted and signed messages. KeyID: FAC37665
36 Fingerprint: 8C16 3F0A A6FC DF0D 19B0 8DEF 48D9 1700 FAC3 7665