Check Linux memory usage

Source: Internet
Author: User
Tags cpu usage

  • 1. To view the process memory usage of the root user, you can use the following command:
    $ top-u Oracle
  • Content Explanation:
    PID: ID of the process
    USER: Process Owner
    PR: The priority level of the process, the smaller the higher the priority is executed
    Ninice: Value
    VIRT: Virtual memory consumed by the process
    RES: The physical memory occupied by the process
    SHR: Shared memory used by the process
    S: The state of the process. s for hibernation, R for running, Z for Zombie, n for the process priority value is negative
    %CPU: Process Consuming CPU utilization
    %MEM: The percentage of physical memory and total memory used by the process
    Time+: The total CPU time that is consumed after the process is started, which is the cumulative value of the CPU usage time.
    Command: Process start name

    注释:      输入top命令后,按键盘“P”,执行按%CPU使用率排行

    After entering the top command, press "T" on the keyboard to perform the mite+ ranking
    After entering the top command, press the keyboard "M" to perform the%mem ranking

      • 2, according to the process to see the memory of the process related information, (process number can be viewed through PS) as follows:
        $ pmap-d 14596

      • 3. See how much memory is actually used
        To view memory usage for all processes in the system, execute the following command:
        $ ps-e-O ' pid,comm,args,pcpu,rsz,vsz,stime,user,uid '

        查看系统指定进程Oracle的内存使用量,执行以下命令:

        $ ps-e-o ' pid,comm,args,pcpu,rsz,vsz,stime,user,uid ' | grep Oracle | Sort-nrk5

    Comments:
    Where Rsz is the actual memory, the above example is implemented by memory sort, from large to small

      • 4. See the N processes that currently occupy the most memory
        $ps-aux | Sort-k4nr | Head-n
        If it is 10 processes, n=10, if it is the highest three, n=3, for example $ps-aux | Sort-k4nr | Head-3
        Use the most CPU K processes
        $ps-aux | Sort-k3nr | Head-k

    Check Linux memory usage

    Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.