/proc//maps
View how the virtual address space of the process is used.
The file has 6 columns, respectively:
Address: library in process address range
Permissions: Virtual memory permissions, r= read, w= write, x=,s= share, p= private;
Offset: library in process address range
Equipment: Image file of the main equipment number and the secondary device number;
Node: the node number of the image file;
Paths: Paths to image files
Each item corresponds to a VM_AREA_STRUCT structure member,
Example:
The body segment of the application (permissions are R-XP) from 0x08048000 to 0x08049000, size 4096, data segment from 0x08049000 to 0x0804a000, size 1KB. The application uses two libraries: Lib and libc. The LIBC body segment is from 0x00391000 to 0x004b4000, the size is 1164KB, the data segment is from 0x004b5000 to 0x004b8000, and the size is 12KB.
The body section of Ld is from 00378000 to 0038d000, the size is 84KB, the data segment is from 0x0038e000 to 0x0038f000, and the size is 4KB. The size of the virtual space used by the application is from 0x4b8000 to 0x378000, the size is 1280KB, but the actual size is Vmlib (1251KB), because it is allocated by page, each page size is 4KB.
Parameter explanation
address:0085d000-00872000 The address space of the starting and ending address files for the virtual memory area
Perms:rw-p permissions: R=read, W=write, X=execute, s=shared, p=private (copy on Write)
offset:00000000 The offset of the virtual memory region in the mapped file
dev:03:08 number and minor number of the primary device
Inode: Device Node number 0 means no node corresponds to memory
Name:/lib/ld-2.3.4.so The filename of the mapped file
The code snippet of each shared library, storing binary executable machine instruction, is a map of the code section of the elf file of the library to the virtual storage space by kernel;
The data segment of each shared library, which holds the global variables required for program execution, is composed of the kernel data segment map to the virtual storage space;
User code snippet, storing binary form executable machine instruction, is by kernel the elf file code segment map to virtual storage space;
The user data segment is a code segment, which holds the global variables required for program execution, and is composed of the data segment map of the Elf file to the virtual storage space by kernel;
Under the user data segment is the heap (heap), when and only when the malloc call exists, is by kernel the anonymous memory map to the virtual storage space, the heap in the program does not call the malloc case does not exist;
Under the user data segment is stack (stack), as the temporary data area of the process, is by kernel the anonymous memory map to the virtual storage space, the growth direction of stack space from high address to low address.
This so-called "linux-gate.so.1" content is the kernel mapping code, the system does not exist in fact such a link library file, its name is by LDD itself, the 0xffffe400 here a piece of code, Here is the system call entry code that the kernel maps for us. Mapped is the size of the application's virtual space, where the value is 4KB larger than the top or PS, and the last 0XFFFFE400-0XFFFFFFFF code; shared gives the shared part of the virtual space.
2/proc//stat
Contains all CPU-active information, all values in the file are accumulated from the start of the system to the current time.
The meaning of each parameter is:
Parameter explanation
pid=6873 process (including lightweight process, that is, thread) number
Comm=a.out the name of an application or command
Task_state=r the status of the task, R:runnign, s:sleeping (task_interruptible), D:disk Sleep (task_uninterruptible), t:stopped, T: Tracing Stop,z:zombie, X:dead
ppid=6723 Parent Process ID
pgid=6873 Thread Group number
sid=6723 c the session group ID for this task
tty_nr=34819 (PTS/3) The device number of the TTY terminal for the task, INT (34817/256) = main device number, (34817-Main device number) = Secondary device number
tty_pgrp=6873 the process group number of the terminal, the PID of the foreground task (including the shell application) that is currently running on the terminal where the task resides.
task->flags=8388608 process flag bit to view the attributes of the task
Min_flt=77 This task does not need to copy data from the hard disk to the number of page faults (secondary pages)
Cmin_flt=0 cumulative the number of times that all waited-for processes of the task have occurred
Maj_flt=0 the number of page faults (master pages) that the task needs to copy data from the hard disk
Cmaj_flt=0 cumulative the task of all the waited-for processes that have occurred the number of main page faults
utime=1587 the time the task is running in user state, in jiffies
Stime=1 the task in the nuclear mentality of the time of operation, Unit for Jiffies
Cutime=0 cumulative the task of all the waited-for processes that once ran in the user state of time, in units of jiffies
Cstime=0 cumulative the task of all the waited-for processes that had ever run in the nuclear mentality of the time, Unit for Jiffies
Dynamic priority of priority=25 tasks
Static priority for nice=0 tasks
Num_threads=3 the number of threads in the thread group where the task is located
It_realvalue=0 the delay of the next SIGALRM send process due to the timing interval, in Jiffy.
start_time=5882654 the time the task was started, in units of jiffies
vsize=1409024 (page) The virtual address space size of this task
RSS=56 (page) The size of this task currently resides in the Physical address space
Number of pages The process has in real Memory,minu 3 for administrative purpose.
These pages may be used for code, data, and stacks.
rlim=4294967295 (bytes) This task can host the maximum value of the physical address space
start_code=134512640 The starting address of the code snippet for this task in the virtual address space
end_code=134513720 the end address of the code snippet for this task in the virtual address space
start_stack=3215579040 the end address of the stack for this task in the virtual address space
The current value of the Kstkesp=0 ESP (32-bit stack pointer) is consistent with the kernel stack page of the process.
kstkeip=2097798 A pointer to the instruction that will be executed, the current value of the EIP (32-bit instruction pointer).
Pendingsig=0 the bitmap of the signal to be processed, recording the normal signal sent to the process
Bitmap of block_sig=0 blocking signal
Bitmap of the sigign=0 ignored signal
Bitmap of the sigcatch=082985 captured signal
Wchan=0 If the process is a sleep state, this value gives the call point of the Dispatch
The number of pages Nswap by swapped is currently useless
Cnswap the number of pages that are swapped by all child processes, and is currently useless
Exit_signal=17 the signal sent to the parent process at the end of the process
Which CPU the TASK_CPU (Task) =0 is running on
Task_rt_priority=0 the relative priority level of real-time processes
task_policy=0 process scheduling strategy, 0 = non-real-time process, 1=fifo real-time process; 2=RR real-time process
3/proc//status
Contains all CPU-active information, all values in the file are accumulated from the start of the system to the current time.
Output explanation
Parameter explanation
Name of the application or command
State task status, run/sleep/zombie/
The average wait time of the SLEEPAVG task (in nanosecond), the interactive task because of the number of hibernate, the time is long, their sleep_avg will be correspondingly larger, so the calculated priority will also be higher.
Tgid Thread Group number
Pid task ID
PPID Parent Process ID
Tracerpid the ID number of the process receiving the process information
UID UID euid suid fsuid
GID GID Egid sgid fsgid
Fdsize the maximum number of file descriptors, File->fds
Groups
Vmsize (KB) task virtual address space size (TOTAL_VM-RESERVED_VM), where TOTAL_VM is the size of the process's address space, RESERVED_VM: The process is in the physical page between reservations or special memory
The size of the physical memory that the VMLCK (KB) task has locked. Locked physical memory cannot be swapped to hard drive (LOCKED_VM)
Vmrss (KB) the size of the physical memory that the application is using is the value of the parameter RSS with the PS Command (RSS)
Vmdata (KB) program data segment Size (the size of the virtual memory), storing initialized data; (TOTAL_VM-SHARED_VM-STACK_VM)
VMSTK (KB) tasks in the user state stack size (STACK_VM)
Vmexe (KB) program has executable virtual memory size, code snippet, excluding the library used by the task (End_code-start_code)
Vmlib (KB) The size of the library that is imaged to the virtual memory space of the task (Exec_lib)
Vmpte the size of all page tables for the process, in kilobytes: KB
Threads shares the number of tasks that use this signal descriptor, in a POSIX multi-line program application where all threads in a thread group use the same signal descriptor.
Number of SIGQ signal to be processed
SIGPND shielding bit, storing the thread's pending signal
SHDPND shielding bit, storing the pending signal of the thread group
Sigblk to store blocked signals
Sigign to store ignored signals
SIGCGT to store the captured signals.
Capinh inheritable, the ability to inherit from programs that are executed by the current process
CAPPRM permitted, the ability of a process to be able to use, can contain the ability that is not in Capeff, these abilities are temporarily abandoned by the process itself, Capeff is a subset of CAPPRM, the process abandons the necessary ability to improve security
Capeff effective, the effective ability of the process
Example 1
You can see that the body segment (1KB) of the application is small, and that the code is minimal, relying on the library (1251KB) for execution. Stack (138KB) is moderate, indicating that there are not too many nested functions or particularly large number of temporary variables. Vmlck 0 indicates that the process does not lock any pages. Vmrss indicates that the current process uses a 2956KB of physical memory. When the process begins to use the memory that has already been requested but has not been used, the value of the vmrss begins to grow, but the vmsize remains unchanged.
[Root@localhost 1]# Cat/proc/4668/status
Name:gam_server
State:s (sleeping)
sleepavg:88%
tgid:31999
pid:31999
Ppid:1
tracerpid:0
uid:0 0 0 0
gid:0 0 0 0
fdsize:256
groups:0 1 2 3 4 6 10
vmsize:2136 KB
vmlck:0 KB
vmrss:920 KB
vmdata:148 KB
vmstk:88 KB
Vmexe:44 KB
vmlib:1820 KB
Vmpte:20 KB
Threads:1
sigq:1/2047
sigpnd:0000000000000000
shdpnd:0000000000000000
sigblk:0000000000000000
sigign:0000000000001006
sigcgt:0000000210000800
capinh:0000000000000000
Capprm:00000000fffffeff
Capeff:00000000fffffeff
[Root@localhost 31999]#
4/proc//statm
Contains all CPU-active information, all values in the file are accumulated from the start of the system to the current time.
Output explanation
CPU and CPU0 ... The meaning of each parameter (in the first act) of each row is:
Parameter Interpretation/proc//status
Size (pages) task virtual address space VMSIZE/4
The size of the physical memory that the resident (pages) application is using VMRSS/4
Shared (pages) share pages 0
The size of the executable virtual memory owned by the TRS (pages) program VMEXE/4
Lrs (pages) the size of the library that is imaged to the virtual memory space of the task VMLIB/4
Drs (pages) program data segment and user state stack size (vmdata+ VMSTK) 4
DT (pages) 0
4
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.