Memstat -- view memory usage of the Shared Library

Source: Internet
Author: User
Article Title: Memstat -- view memory usage of the shared library. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

We can use a tool such as top or System Manager to check the memory usage of each process. However, the memory contains not only the processes you run, but also the shared libraries required by the processes, for example, the most basic libc. so. These shared libraries have only one copy in the physical memory and are shared by multiple processes. When we view process information in top, there will be two projects: RSS and VSZ, the former is the memory usage of the process itself, and the latter is the total usage of the shared library.

Memstat is a small program that can help you view the memory usage of each shared library and make them exist.

Run memstat-w to list the information of all the current shared libraries:

Memstat-w

If the-w parameter is not added, memstat truncates excessively long information to 80 columns. Effect

The first column is the memory usage, followed by the full path of the shared library, and the last number is the PID of the shared library process. We can see that many shared libraries are followed by many PIDs, indicates that the shared database is shared by multiple processes.

You can configure the directory of the execution file in/etc/memstat. conf. memstat will only investigate the executable file sharing library information under these directories.

If you want to check that the Shared Library occupies the most memory, you only need to use sort to filter it out:

Memstat-w | sort-rn

You can ~

Memstat is available in both Debian and Ubuntu, but I didn't find its home page. If your software repository does not have memstat, you can download it locally. This package was transferred through deb2targz.

Related Article

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.