[aclug-L] Determining memory usage by a user
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
If it is at all possible (I'm beginning to think it's not), I need to find a
way to determine how much memory a specific user is using.
My first thought was to add the values of the VSZ or RSS fields from ps's
output. This, however, is worthless:
VSZ tells the entire 'virtual memory' usage by each process, which includes
shared memory. This means that a memory segment used by multiple processes
is counted multiple times. As an example of how worthless this is, if I add
the VSZ values for every process on my router machine, the result is 712mb
of used memory. That machine has only 32mb of physical RAM and 32mb of
swap, so it is physically impossible for the used memory to ever exceed
The RSS value is also nearly-worthless, as it only reports 'resident' memory
(i.e. memory not in swap space). I have been unable to determine how the
RSS value treats shared memory, but if I add all values in the RSS field on
all processes, it always seems to roughly equal the amount of used memory
reported by 'free', so I think this value is close to accurate.
If I can find some way to determine how much swap space is used by a process
(or all processes owned by a user), then I could possibly use the sum of
that value and the values of RSS from ps to come up with a reasonable
estimate for the total memory used by the user.
Can anyone think of a way to accomplish this?
-- This is the discussion@xxxxxxxxx list. To unsubscribe,
- [aclug-L] Determining memory usage by a user,
Jonathan Hall <=