AIX Memory and Process Resource Usage Commands
View Memory Usage
We use the following to view physical memory system:
vmstat
svmon -Gtopas
Run nmon, then press m
You can use lsps -s to check swap space usage. If physical memory is under little pressure, swap usage will be low.
For database systems, the larger the physical memory, the less it uses swap space and the fewer disk I/O operations occur with storage.
comp refers to computation, typically used by applications or databases; nocomp refers to non-computation, typically used for filesystem caching. The sum of comp and nocomp represents the total physical memory usage rate.
Memory pages in the nocomp section store files and data used by the system and applications as cache to improve performance. Generally, nocomp pre-allocates unused memory for filesystem caching.
Initially, the usage rate of this nocomp section is relatively small. As business operations continue for a longer time, the nocomp usage rate increases, potentially approaching full occupancy of physical memory. If new paging work occurs due to new files or data, the system releases infrequently used resources from the non-computational memory area to accommodate the new data.
The specific amount of non-computational memory space occupied is determined by the minperm and maxperm parameters in the system's vmo configuration. The actual usage falls between these two values. During database installation, recommended parameter settings are usually provided.
Physical memory usage for areas such as filesystemcache depends on system parameters. These parameters must be configured according to requirements from different application vendors, typically set before application installation based on vendor specifications.
Occupancy of these memory cache regions is controllable via parameters. You must adhere to application requirements; for example, Oracle provides recommended parameters for different environments. Do not modify them arbitrarily, as doing so may impact performance or cause issues.
The content displayed by svmon actually includes non-computational paged memory. Regardless of physical memory size, the non-computational paged region will occupy all physical memory. This involves placing relevant business files and data into the non-computational paged area to enhance performance. When new paging work occurs (i.e., new data utilizes these regions), the system releases infrequently used resources within the non-computational memory area for the new data. The specific amount of non-computational memory space occupied is determined by the minperm and maxperm parameters in the system's vmo configuration, with actual usage falling between these two values. To reduce its footprint, you must adjust the maxperm parameter.
To determine how much memory is used by the computational and non-computational memory areas, use the topas command and the nmon command.
Use vmo -a to view relevant parameters.
Sort Processes by Memory Usage
Process Sorting by Memory Usage Rate
ps aux | head -1 ; ps aux | sort -rn +3 | head -10Detailed Process Information
ps -ealf | head -1 ; ps -ealf | sort -rn +9 | head -10Display the top 10 processes consuming the most physical memory
svmon -uP -t 10|grep -p Pid|grep '^.*[0-9] 'Resource Usage Check Commands
(2) Display the 10 processes consuming the most memory
#ps vx |head -1 ;ps vx |grep -v PID |sort -rn +6 |head -10
(3) Display the 10 processes with the most swapping
#ps vx |head -1 ;ps vx |grep -v PID |sort -rn +4 |head -10