How to Check Swap and Memory Usage Live via the 'top' Command on Oracle Linux 5, 6, 7, and 8

本文介绍如何使用'top'命令实时查看OracleLinux5、6、7和8的系统内存及交换区使用情况,帮助识别高消耗进程。针对不同版本的OracleLinux,提供了详细的步骤指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

How to Check Swap and Memory Usage Live via the 'top' Command on Oracle Linux 5, 6, 7, and 8. (文档 ID 2422888.1)

APPLIES TO:

Oracle Cloud Infrastructure - Version N/A and later
Linux OS - Version Oracle Linux 6.0 and later
Linux x86-64

GOAL

View the system wide swap and memory usage on an Oracle Linux server via the top command to identify the highest consumers.

If you would rather review the swap usage by a specific process review the document below:

How To Check Swap Usage of Each Processes (Doc ID 1931980.1)

SOLUTION

 Below are the steps for Oracle Linux 5  and 6 which are the same, followed by Oracle Linux 7 and Oracle Linux 8 as they differ on newer releases:

NOTE: Performing this task will not cause any changes to top command, this is only temporary while you have your top command running. Exiting top and starting it again will reset your changes.

Oracle Linux 5 and Oracle Linux 6:

Checking swap usage:

1a. Run the TOP command:

# top

1.b: On your keyboard press the " f " key followed by " p " to add the Swap column, Hit enter.

1.c: Next upper case "O" and finally "p" sort by swap, Hit enter.

1.d: Perform your review as needed and press "q" to exit top command.

 

Checking memory usage:

1e. Run the TOP command:

# top

1.f: Next upper case "O" and finally "n" sort by %MEM, Hit enter.

1.g: Perform your review as needed and press "q" to exit top command.

 

Oracle Linux 7 and Oracle Linux 8:

Checking swap usage:

2a. Run the TOP command:

# top

2b. On your keyboard press the " f " key and scroll down using the <down> arrow key until you have selected "SWAP" then press <Space> to select it. This should add a " * " symbol in front of it.

2c. While still selecting "SWAP"  press the <right> arrow key, which highlights the entire SWAP line, and using the <top> arrow key move it up to one of the first options (anywhere above "COMMAND").

2d. While still having "SWAP" selected, type the " s " key which will configure top to SORT by the currently selected option, in this case SWAP.

2e. Finally " q " to save the configuration changes and view the results.

2f. Perform your review as needed and press "q" again to exit top command.

 

Checking memory usage:

2g. Run the TOP command:

# top

2h. On your keyboard press the " f " key and scroll down using the <down> arrow key until you have selected "%MEM"

2i. While still having "%MEM" selected, type the " s " key.

2j. Finally " q " to save the configuration changes and view the results.

2k. Perform your review as needed and press "q" again to exit top command.

 

For more information on top options and fields review the man page. Below are a few lines from the top man page that provide some information on the memory fields and what they represent.

# man top

 

MEM -- Memory Usage (RES)
A task's currently used share of available physical memory.

RES -- Resident Memory Size (KiB)
The non-swapped physical memory a task is using.

SHR -- Shared Memory Size (KiB)
The amount of shared memory available to a task, not all of which is typically resident. It simply reflects memory that could be potentially shared with other processes.

SWAP -- Swapped Size (KiB)
The non-resident portion of a task's address space.

VIRT -- Virtual Memory Size (KiB)
The total amount of virtual memory used by the task. It includes all code, data and shared libraries plus pages that have been swapped out and pages that have been mapped but not used.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值