pt-summary is not showing "shared" memory value

Bug #1553340 reported by Daniel Guzmán Burgos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Medium
Frank Cizmich

Bug Description

Memory space used by files inside a partition mounted with the tmpfs filesystem is reported in the "shared" section of the output of the "free" command, as explained in the docs (https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt):

"Since tmpfs lives completely in the page cache and on swap, all tmpfs
pages will be shown as "Shmem" in /proc/meminfo and "Shared" in
free(1)."

The "parse_free_minus_b" function doesn't take in account that section:

name_val "Total" $(shorten $(awk '/Mem:/{print $2}' "${file}") 1)
   name_val "Free" $(shorten $(awk '/Mem:/{print $4}' "${file}") 1)
   name_val "Used" "physical = $(shorten ${physical} 1), swap allocated = $(shorten ${swap_alloc} 1), swap used = $(shorten ${swap_used} 1), virtual = ${virtual}"
   name_val "Buffers" $(shorten $(awk '/Mem:/{print $6}' "${file}") 1)
   name_val "Caches" $(shorten $(awk '/Mem:/{print $7}' "${file}") 1)
   name_val "Dirty" "$(awk '/Dirty:/ {print $2, $3}' "${file}")"

Which, based on the free output, is the fifth column:

             total used free shared buffers cached
Mem: 2099093504 1454759936 644333568 1036288 37773312 540282880
-/+ buffers/cache: 876703744 1222389760
Swap: 0 0 0

Fix: Add the following line:

 name_val "Shared" $(shorten $(awk '/Mem:/{print $5}' "${file}") 1)

Changed in percona-toolkit:
status: New → Confirmed
status: Confirmed → Triaged
Changed in percona-toolkit:
status: Triaged → Fix Committed
importance: Undecided → Medium
assignee: nobody → Frank Cizmich (frank-cizmich)
milestone: none → 2.2.18
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-702

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.