Active Oldest Votes. Quoting from lwn. Community Bot 1 1 1 silver badge. Pavan Manjunath Pavan Manjunath Do I need to add all the PSS to actually compute the size taken up by the binary. Is this size equal to the size occupied in the RAM? Sign up or log in Sign up using Google. Sign up using Facebook.
Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. This file provides a symbolic trace of the function calls in this process's kernel stack. Status information about the process. This is used by ps 1. The fields, in order, with their proper scanf 3 format specifiers, are:. The filename of the executable, in parentheses.
This is visible whether or not the executable is swapped out. The controlling terminal of the process. The minor device number is contained in the combination of bits 31 to 20 and 7 to 0; the major device number is in bits 15 to 8.
The kernel flags word of the process. Details depend on the kernel version. The number of minor faults the process has made which have not required loading a memory page from disk.
The number of major faults the process has made which have required loading a memory page from disk. See also times 2. Explanation for Linux 2. For processes running under a non-real-time scheduling policy, this is the raw nice value setpriority 2 as represented in the kernel.
The kernel stores nice values as numbers in the range 0 high to 39 low , corresponding to the user-visible nice range of to Before Linux 2. The nice value see setpriority 2 , a value in the range 19 low priority to high priority.
Number of threads in this process since Linux 2. Since kernel 2. The time the process started after system boot. In kernels before Linux 2. Resident Set Size: number of pages the process has in real memory. This is just the pages which count toward text, data, or stack space. This does not include pages which have not been demand-loaded in, or which are swapped out.
The bitmap of pending signals, displayed as a decimal number. The bitmap of blocked signals, displayed as a decimal number.
The bitmap of ignored signals, displayed as a decimal number. The bitmap of caught signals, displayed as a decimal number. This is the "channel" in which the process is waiting. It is the address of a location in the kernel where the process is sleeping. Address above which program heap can be expanded with brk 2. The thread's exit status in the form reported by waitpid 2. Here's an example:. State : Current state of the process.
SigQ : This field contains two slash-separated numbers that relate to queued signals for the real user ID of this process. SigPnd , ShdPnd : Number of signals pending for thread and for process as a whole see pthreads 7 and signal 7. CapInh , CapPrm , CapEff : Masks of capabilities enabled in inheritable, permitted, and effective sets see capabilities 7.
CapBnd : Capability Bounding set since Linux 2. This file exposes the system call number and argument registers for the system call currently being executed by the process, followed by the values of the stack pointer and program counter registers.
The values of all six argument registers are exposed, although most system calls use fewer registers. If the process is blocked, but not in a system call, then the file displays -1 in place of the system call number, followed by just the values of the stack pointer and program counter.
If process is not blocked, then file contains just the string "running". This is a directory that contains one subdirectory for each thread in the process. The name of each subdirectory is the numerical thread ID [tid] of the thread see gettid 2. These files expose the mappings for user and group IDs inside the user namespace for the process pid. Each line in the file specifies a 1-to-1 mapping of a range of contiguous between two user namespaces.
The specification in each line takes the form of three numbers delimited by white space. The first two numbers specify the starting user ID in each user namespace. The third number specifies the length of the mapped range. In detail, the fields are interpreted as follows:. The start of the range of user IDs to which the user IDs specified by field one map. If the two processes are in the same user namespace: field two is the start of the range of user IDs in the parent user namespace of the process pid.
There is an arbitrary limit on the number of lines in the file. As at Linux 3. The range of user IDs specified in each line cannot overlap with the ranges in any other lines. In the current implementation Linux 3. The process must be in either the user namespace of the process pid or inside the parent user namespace of the process pid. This file contains information which is used for diagnosing memory fragmentation issues. Each line starts with the identification of the node and the name of the zone which together identify a memory region This is then followed by the count of available chunks of a certain order in which these zones are split.
The size in bytes of a certain order is given by the formual:. The binary buddy allocator algorithm inside the kernel will split one chunk into two chunks of a smaller order thus with half the size or combine two contiguous chunks into one larger chunk of a higher order thus with double the size to satisfy allocation requests and to counter memory fragmentation. The order matches the column number, when starting to count at zero. In this example, there is one node containing three zones and there are 11 different chunk sizes.
If the page size is 4 kilobyteis, then the first zone called DMA on x86 the first 16 megabyte of memory has 1 chunk of 4 kilobytes order 0 available and has 3 chunks of 4 megabytes order 10 available. If the memory is heavily fragmentated, the counters for higher order chunks will be zero and allocation of large contiguous areas will fail. Each timer is listed with a line that started with the string "ID:". For example:. The ID for this timer. Valid only for timers that notify via a signal.
The part before the slash specifies the mechanism that this timer uses to deliver notifications, and is one of "thread", "signal", or "none". Following the ". This field identifies the clock that the timer uses for measuring time. Contains various bus subdirectories and pseudo-files containing information about PCI busses, installed devices, and device drivers.
Information about PCI devices. They may be accessed through lspci 8 and setpci 8. Arguments passed to the Linux kernel at boot time. Often done via a boot manager such as lilo 8 or grub 8. This file exposes the configuration options that were used to build the currently running kernel, in the same format as they would be shown in the. The file contents are compressed; view or search them using zcat 1 and zgrep 1. This is a collection of CPU and system architecture dependent items, for each supported architecture a different list.
Two common entries are processor which gives CPU number and bogomips ; a system constant that is calculated during kernel initialization. The lscpu 1 command gathers its information from this file.
Text listing of major numbers and device groups. A text listing of the filesystems which are supported by the kernel, namely filesystems which were compiled into the kernel or whose kernel modules are currently loaded. See also filesystems 5. If a filesystem is marked with "nodev", this means that it does not require a block device to be mounted e. Incidentally, this file may be used by mount 8 when no filesystem is specified and it didn't manage to determine the filesystem type.
Then filesystems contained in this file are tried excepted those that are marked with "nodev". Contains subdirectories that in turn contain files with information about certain mounted filesystems. This directory exists on systems with the IDE bus. There are directories for each IDE channel and attached device. Files include:. The hdparm 8 utility provides access to this information in a friendly format. This holds the kernel exported symbol definitions used by the modules X tools to dynamically link and bind loadable modules.
In Linux 2. This file represents the physical memory of the system and is stored in the ELF core file format. This file can be used instead of the syslog 2 system call to read kernel messages. A process must have superuser privileges to read this file, and only one process should read this file. This file should not be read if a syslog process is running which uses the syslog 2 system call facility to log kernel messages. Information in this file is retrieved with the dmesg 1 program.
The bits are as follows:. They are the same as the load average numbers given by uptime 1 and other programs. The first of these is the number of currently runnable kernel scheduling entities processes, threads. The value after the slash is the number of kernel scheduling entities that currently exist on the system. The fifth field is the PID of the process that was most recently created on the system. This file shows current file locks flock 2 and fcntl 2 and leases fcntl 2. This file reports statistics about memory usage on the system.
It is used by free 1 to report the amount of free and used memory both physical and swap on the system as well as the shared memory and buffers used by the kernel. Each line of the file consists of a parameter name, followed by a colon, the value of the parameter, and an option unit of measurement e.
The list below describes the parameter names and the format specifier required to read the field value. Except as noted below, all of the fields have been present since at least Linux 2. Some fields are displayed only if the kernel was configured with various options; those dependencies are noted in the list.
Relatively temporary storage for raw disk blocks that shouldn't get tremendously large 20MB or so. In-memory cache for files read from the disk the page cache.
Doesn't include SwapCached. Memory that once was swapped out, is swapped back in but still also is in the swap file. If memory pressure is high, these pages don't need to be swapped out again because they are already in the swap file. Memory which has been less recently used. It is more eligible to be reclaimed for other purposes. From Linux 2. Starting with Linux 2. Total amount of highmem. Highmem areas are for use by user-space programs, or for the page cache.
The kernel must use tricks to access this memory, making it slower to access than lowmem. Amount of free highmem. Total amount of lowmem. Lowmem is memory which can be used for everything that highmem can be used for, but it is also available for the kernel's use for its own data structures. Among many other things, it is where everything from Slab is allocated. Bad things happen when you're out of lowmem.
Amount of free lowmem. Files which have been mapped into memory with mmap 2 , such as libraries. This is the total amount of memory currently available to be allocated on the system, expressed in kilobytes.
The amount of memory presently allocated on the system. The committed memory is a sum of all of the memory which has been allocated by processes, even if it has not been "used" by them as of yet.
A process which allocates 1GB of memory using malloc 3 or similar , but touches only MB of that memory will show up as using only MB of memory even if it has the address space allocated for the entire 1GB. This 1GB is memory which has been "committed" to by the VM and can be used at any time by the allocating application. This is useful if one needs to guarantee that processes will not fail due to lack of memory once that memory has been successfully allocated.
Non-file backed huge pages mapped into user-space page tables. The number of huge pages in the pool that are not yet allocated. This is the number of huge pages for which a commitment to allocate from the pool has been made, but no allocation has yet been made. These reserved huge pages guarantee that an application will be able to allocate a huge page from the pool of huge pages at fault time.
A text list of the modules that have been loaded by the system. See also lsmod 8. With the introduction of per-process mount namespaces in Linux 2. Memory Type Range Registers. However, the standard netstat 8 suite provides much cleaner access to these files.
It will show both dynamically learned and preprogrammed ARP entries. The format is:. The dev pseudo-file contains network device status information. This gives the number of received and sent packets, the number of errors and collisions and other basic statistics. These are used by the ifconfig 8 program to report device status. This file uses the same format as the arp file and contains the current reverse mapping database used to provide rarp 8 reverse address lookup services. If RARP is not configured into the kernel, this file will not be present.
Holds a dump of the RAW socket table. Much of the information is not of use apart from debugging. The "uid" field holds the effective UID of the creator of the socket. Holds a dump of the TCP socket table. Holds a dump of the UDP socket table. Here "Num" is the kernel table slot number, "RefCount" is the number of users of the socket, "Protocol" is currently always 0, "Flags" represent the internal kernel flags holding the status of the socket.
Currently, type is always "1" UNIX domain datagram sockets are not yet supported in the kernel. Contains the major and minor numbers of each partition as well as the number of byte blocks and the partition name. It became optional in Linux 2. It became once more nonoptionally enabled in Linux 2. Next, it was deprecated in Linux 2.
Some of the counters reported here overlap. The memory reported by the non overlapping counters may not add up to the overall memory usage and the difference for some workloads can be substantial. You may not have all of these fields. An estimate of how much memory is available for starting new applications, without swapping.
The estimate takes into account that the system needs some page cache to function well, and that not all reclaimable slab will be reclaimable, due to items being in use.
The impact of those factors will vary from system to system. Memory which has been less recently used. It is more eligible to be reclaimed for other purposes. Highmem areas are for use by userspace programs, or for the pagecache.
The kernel must use tricks to access this memory, making it slower to access than lowmem. Among many other things, it is where everything from the Slab is allocated.
Kernel allocations that the kernel will attempt to reclaim under memory pressure. Includes SReclaimable below , and other direct allocations with a shrinker. Always zero. Previous counted pages which had been written to the server, but has not been committed to stable storage. The amount of memory presently allocated on the system. This is useful if one needs to guarantee that processes will not fail due to lack of memory once that memory has been successfully allocated.
Memory allocated to the percpu allocator used to back percpu allocations. This stat excludes the cost of metadata. One line per area, containing the virtual address range of the area, size in bytes, caller information of the creator, and optional information depending on the kind of area:.
There is one subdirectory for each IDE controller, the file drivers and a link for each IDE device, pointing to the device directory in the controller specific subtree. More detailed information can be found in the controller specific subdirectories. These are named ide0, ide1 and so on. Each of these directories contains the files shown in table Each device connected to a controller has a separate subdirectory in the controllers directory.
The files listed in table are contained in these directories. The most interesting file is settings. This file contains a nice overview of the drive parameters:. Table shows the additional values you get for IP version 6 if you configure the kernel to support this. Table lists the files and their meaning. You can use this information to see which network devices are available in your system and how much traffic was routed over those devices:.
In addition, each Channel Bond interface has its own directory. It will contain information that is specific to that bond, such as the current slaves of the bond, the link status of the slaves, and how many times the slaves link has failed.
The directory named after the driver has one file for each adapter found in the system. These files contain information about the controller, including the used IRQ and the IO address range. The amount of information shown is dependent on the adapter you use. It has one subdirectory for each port, named after the port number 0,1,2,…. IRQ that parport is using for that port. This is in a separate file to allow you to alter it by writing a new value in IRQ number or none.
All of the numbers reported in this file are aggregates since the system first booted. For a quick look, simply cat the file:. These numbers identify the amount of time the CPU has spent performing different kinds of work.
The meanings of the columns are as follows, from left to right:. But there are several problems:. The first column is the total of all interrupts serviced including unnumbered architecture specific interrupts; each subsequent column is the total for that particular numbered interrupt. Unnumbered interrupts are not shown, only summed into the total. The first column is the total of all softirqs serviced; each subsequent column is the total for that particular softirq.
The files in each per-device directory are shown in Table , below. It not only allows access to process data but also allows you to request the kernel status by reading files in the hierarchy.
This is not only a source of information, it also allows you to change parameters within the kernel. Be very careful when attempting this. You can optimize your system, but you can also cause it to crash.
Never alter kernel parameters on a production system. Set up a development machine and test to make sure that everything works the way you want it to. You may have no alternative but to reboot the machine once an error has been made. To change a value, simply echo the new value into the file. You need to be root to do this. You can create your own boot script to perform this every time your system boots. Since some of the files can inadvertently disrupt your system, it is advisable to read both documentation and source before actually making adjustments.
In any case, be very careful when writing to any of these files. This chapter is heavily based on the documentation included in the pre 2. Certain aspects of kernel behavior can be modified at runtime, without the need to recompile the kernel, or even to reboot the system. You can use the echo command to write value into these files, thereby changing the default settings of the kernel. These files can be used to adjust the badness heuristic used to select which process gets killed in out of memory oom conditions.
The badness heuristic assigns a value to each candidate task ranging from 0 never kill to always kill to determine which process is targeted. The units are roughly a proportion along that range of allowed memory the process may allocate from based on an estimation of its current memory and swap use.
0コメント