[PLUG] Possible memory leak?

rddunlap at osdl.org rddunlap at osdl.org
Sat May 4 18:17:57 UTC 2002


On Sat, 4 May 2002, John Hampton wrote:

| 	I just looked at the output of top today and it says
| that I only have about 400k of free physical memory (no swap
| is being used).  Now, in and of itself that doesn't seem too
| weird, however, I have 128 MB RAM in the box and it isn't under
| any type of load.  Also, a couple of days ago, top said I
| have greater than 20 MB of physical memory free.  And nothing
| has changed on the box between then and now.  So, I was wondering
| if there is a way to get a break down of all the memory being
| used in the system.  Something that would tell me exactly how
| much memory each process is using.  Also, I don't run X on the
| box, so a console based utility is essential.  Thanks for any
| bright ideas.

Linux doesn't attempt to free up memory until it's needed
by some other process, so having lots of memory in use
is good, not bad.

Tools:  top (like you are using), cat /proc/meminfo,
	cat /proc/slabinfo, Als-SysRq-M (if enabled)

Also, for each process, /proc/<process_number/statm prints:
		       size, resident, share, trs, lrs, drs, dt
where:
	size = number of total pages
	resident = number of resident pages
	share = number shared
	trs = number of text (code) pages
	lrs = number of library pages
	drs = number of stack/data pages
	dt = number dirty

And you can use 'h' in top to see how to
customize its field output, then use 'f' or 'F' to add or
delete fields (columns).

There's also 'vmstat', but it doesn't help very much on a
per-process basis.

-- 
~Randy





More information about the PLUG mailing list