Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the slabtop command in Linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to use the slabtop command in Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The Linux common command slabtop command displays the details of the kernel "slab" buffer in real time.

Slabtop real-time display kernel slab memory cache information

Syntax slabtop (option) option-- delay=n,-d n: update the displayed information every n seconds, default is every 3 seconds;-- sort=S,-s S: specify sorting criteria to sort (sort criteria, see below or man manual);-- once,-o: display once and then exit;-- version,-V: display version;-- help: display help information. Sorting criteria:

A: sort by number of active objects

B: sort by objects per slab

C: sort by cache size

L: sort by number of slabs

V:sort by number of active slabs

N: sort by name

O: sort by number of objects

P: sort by pages per slab

S: sort by object size

U: sort by cache utilization

When the module of knowledge extension kernel allocates resources, in order to improve the efficiency and utilization of resources, it is allocated through slab. Through the information of slab, combined with the source code, we can roughly understand the operation of the system, such as what resources are abnormal, or what resources are leaked. The linux system exposes slab usage to users through / proc/slabinfo.

The slab allocator used by Linux is based on an algorithm first introduced by Jeff Bonwick for the SunOS operating system. The allocator of Jeff revolves around the object cache. In the kernel, a large amount of memory is allocated for a limited set of objects, such as file descriptors and other common structures. Jeff found that initializing normal objects in the kernel takes longer than it takes to allocate and release them. Therefore, he concluded that memory should not be released back to a global memory pool, but should be kept in a state initialized for a specific purpose. The Linux slab allocator uses this and other ideas to build a memory allocator that is efficient in both space and time.

The file that holds information about all active slab caches in the monitoring system is / proc/slabinfo.

Instance slabtop Active / Total Objects (% used): 897519 / 1245930 (72.0%) Active / Total Slabs (% used): 38605 / 38605 (100.0%) Active / Total Caches (% used): 94 / 145 (64.8%) Active / Total Size (% used): 129558.22K / 153432.58K (84.4%) Minimum / Average / Maximum Object: 0.01K / 0.12K / 128.00K OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME 440136 171471 38% 0.05K 6113 72 24452K buffer_head 190086 148576 78% 0.05K 2437 78 9748K selinux_inode_security 151840 146366 96% 0.48K 18980 8 75920K ext3_inode_cache 144333 144143 99% 0.02K 711 203 2844K avtab_node 130529 128488 98% 0.13K 4501 29 18004K Dentry_cache 99214 99071 99% 0.03K 878 113 3512K size-32 43834 28475 64% 0.27K 3131 14 12524K radix_tree_node 17818 9450 53% 0.06K 302 59 1208K size-64 4602 4562 99% 0.05K 59 78 236K sysfs_dir_cache 3220 2855 88% 0.08K 70 46 280K vm_area _ struct 2460 2114 85% 0.12K 82 30 328K size-128 1564 1461 93% 0.04K 17 92 68K Acpi-Operand 1540 1540 1540 0.33K 140 11 560K inode_cache 1524 466 30% 0.01K 6254 24K anon_vma 1440 515 35% 0.05K 20 72 80K avc_node 1440 1154 80% 0.19K 72 20 288K filp 1170 1023 87% 0.05K 15 78 60K ext3_xattr 845724 85% 0.02K 5169 20K Acpi-Namespace 638315 49% 0.35K 58 11 232K proc_inode_cache 450434 96% 0.25K 30 15 120K size-256 424 386 91% 0.50K 53 8 212K size-512 312 107 34% 0.05K 4 78 16K delayacct_cache 306 284 92% 0.43K 34 9 136K shmem_inode_cache 303 108 35% 0.04K 3 101 12K pid 300 261 87% 0.19K 15 20 60K skbuff_head_cache 300 100% 0.12K 10 30 40K bio 260 260 100% 32.00K 260 1 8320K size-32768 254 62% 0.01K 1254 4K revoke_table 236 55 23% 0.06K 459 16K fs_cache 216 203 93% 1.00K 54 4 216K size-1024 214 214 100% 2.00K 107 2 428K size-2048 203 83 40% 0.02K 1203 4K biovec-1 thank you for reading! This is the end of the article on "how to use slabtop commands in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report