vm_size of a process in the kernel

From: Derk Tegeler <derk.tegeler_at_eurocontrol.int>
Date: Thu, 04 Apr 2002 17:53:59 +0200

All,

I'm trying to identify the amount of virtual memory a process is using. On
a running system the obvious is to use the 'ps' command with appropriate flags.

In a core file, however, dbx should return it with the command below. The
output however, baffles me:

On a running system
# ps -o pid,vsz,comm -p 122
    PID VSZ COMMAND
    122 1.64M syslogd

(dbx) set $pid=122
(dbx) pd (*(struct thread *)$tid).task.map.vm_size
17170432

that's 16.375M<something>

/usr/sys/include/vm/vm_map.h contains
struct vm_map {
        ...
        vm_size_t vm_size; /* virtual size */
        ...
};

My question is: should vm_size be the same as VSZ reported by 'ps' and if
not, how can I find out the size of the virtual memory a process is using
or has used (in a kernel core file) using dbx?

This is on v4.0f but I thought I saw the same on 5.1.

Regards,

Derk
Received on Thu Apr 04 2002 - 15:56:04 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:43 NZDT