Professional Documents
Culture Documents
Products & Services Tools Security Community
7
Products & Services Knowledgebase [RHEL] How do I check for hugepages usage and what is using it?
[RHEL] How do I check for hugepages usage and what is using it?
$ SOLUTION VERIFIED - Updated February 25 2019 at 11:32 AM - English
Environment
Red Hat Enterprise Linux 5
Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 7
Red Hat Enterprise Linux 8
Issue
How do I check for what is using my system hugepages?
How to caculate the size of hugepage used by a specified process?
Resolution
Kernel perspective
Get notified when this content is updated FOLLOW b
1. First, check for the current hugepages usage:
Raw
2. Now, let's deduct the free pages, so we can find the used pages and sum to it the reserved pages. So the allocated pages is going to be
Total - Free + Rsvd
Raw
3. Multiply the alloocated pages by 2048 (2048 is the number of kbytes of a single page)
Raw
4. If you want to put the kbytes in byte count, multiply it by 1024 (1 kbyte = 1024 bytes):
Raw
Raw
2. Sum the 5th column (quick shell: ipcs -m|awk '{ print $5}'|awk '{a+=$0}END{print a}' ) and match against /proc/meminfo hugepages
information (see procedure above). If the values matches, then you have a hugepages-only shared memory. If you get a larger value, you have
4kb regular pages shared memory in use as well. Just deduct this sum from /proc/meminfo hugepages value in bytes and then you'll find how
much you have of regular 4kb pages.
Check if you are using a hugepages filesystem. Grep for huge in /proc/mounts :
Raw
Unfortunately, at this time there are no means to quantify private hugetlbfs pages, which are used for qemu-kvm , for example.
The following command can be used to caculate the size of hugepage used by a specified process, assumption that HugePage size is 2048
kB, the output unit is MiB:
Raw
grep -B 11 'KernelPageSize: 2048 kB' /proc/[PID]/smaps | grep "^Size:" | awk 'BEGIN{sum=0}{sum+=$2}END{print sum/1024}'
Product(s) Red Hat Enterprise Linux Component kernel Category Troubleshoot Tags hugepages kernel memory rhel_6 rhel_7 rhel_8
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while
supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and
unedited form.
Memory size by free and ipcs contain also How do I calculate used Hugepages? How do I tell which application is using
HugePages which HugePages?
Solution - Jan 22, 2016 Solution - Feb 24, 2019 Solution - Feb 25, 2019
1 Comments
RL
NEWBIE
2 Points
LH I poked around in /proc/vm/$pid/numa_stat and found some info that appears to be hugepage usage.
≤ Reply
Copyright © 2021 Red Hat, Privacy Statement Customer Portal Terms of Use All Policies and Guidelines
Inc. Cookie Preferences