Re: Need assistance in determining memory usage

Andy Isaacson (adi@hexapodia.org)
Wed, 6 Nov 2002 13:42:58 -0600


On Mon, Nov 04, 2002 at 01:22:44PM -0600, Thomas Schenk wrote:
> On Mon, 2002-11-04 at 13:01, Alan Cox wrote:
> > On Mon, 2002-11-04 at 18:11, Thomas Schenk wrote:
> > > was adequate, I wouldn't be asking here and every reference I could find
> > > indicates that this is not a trivial problem. There were also
> > > indications I found while searching that these tools do not always
> > > report memory numbers accurately. If there is a way to determine this
> > > information using /proc, this would be ideal, since I could then
> > > conceivably create a script or simple program that could determine the
> > > answer given the process ID, which is what the developers here really
> > > want.
> >
> > Neither the question nor the answer are trivial. What are you trying to
> > do with the data may be the most relevant question
>
> This situation is this:
>
> 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 (as reported by ps). Part of
> this is due to the fact that the processes have not been optimized to
> make the most efficient use of memory. When the simulator processes
> start swapping, then the systems are becoming unstable, performance goes
> all to hell and sometimes the systems totally hang. 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.

I do not believe that the kernel exports the information "what processes
are using swap?". You can answer some of your questions by using my
pmap program; it's in at least some recent procps packages, or download
the source:
http://web.hexapodia.org/~adi/pmap.c

-andy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/