From: Dan Kegel <dkegel@ixiacom.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Thomas Schenk <tschenk@origin.ea.com>
Subject: Re: Need assistance in determining memory usage
Date: Mon, 04 Nov 2002 13:11:28 -0800 [thread overview]
Message-ID: <3DC6E280.6050409@ixiacom.com> (raw)
Thomas Schenk <tschenk@origin.ea.com> wrote:
> We are building an online game system. On some of
> the systems, there are simulator processes running
> that each service a player. There may be up to
> 200 or more of these processes running at any given
> time and each uses a fairly large amount of memory
> ... When the simulator processes start swapping,
> the systems are becoming unstable, performance goes
> all to hell... It would
> be useful for us to be able to monitor as closely as
> possible the amount of memory each processes is using
> and especially to be notified when these processes
> start using significant amounts of swap, so that we
> can be prepared to react before the situation gets
> out of hand. The other reason why we want to collect
> this data is so that the developers can analyze the
> process when it starts to swap ...
A few things you might try:
1. Set RLIMIT_DATA or RLIMIT_AS for your processes
using ulimit. That should cause malloc() and the
like to return NULL or throw an exception if you go
over the limit. (RLIMIT_AS doesn't work too well
on heavily multithreaded programs, though, because
of the many stacks.)
2. Try the no-overcommit patch. That will fail
allocation requests that might conceivably cause swapping
later. Harsh, but you did want early notification :-)
3. Start reading the kernel source to see how it calculates
memory use and enforces the above limits. That helped
clarify things for me a bit.
4. If you're feeling really nasty, you could try applying
my patch that implements RLIMIT_RSS by killing the process.
That's pretty immediate feedback, too :-)
- Dan
next reply other threads:[~2002-11-04 21:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-04 21:11 Dan Kegel [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-11-04 18:11 Need assistance in determining memory usage Thomas Schenk
2002-11-04 18:18 ` bert hubert
2002-11-04 18:34 ` Ketil Froyn
2002-11-04 18:40 ` Richard B. Johnson
2002-11-04 19:01 ` Alan Cox
2002-11-04 19:22 ` Thomas Schenk
2002-11-06 19:42 ` Andy Isaacson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3DC6E280.6050409@ixiacom.com \
--to=dkegel@ixiacom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tschenk@origin.ea.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.