{"id":466,"date":"2015-12-12T12:04:03","date_gmt":"2015-12-12T12:04:03","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2015\/12\/12\/20-pmap-commands-examples-in-linux-unix\/"},"modified":"2022-04-24T04:22:01","modified_gmt":"2022-04-24T04:22:01","slug":"20-pmap-commands-examples-in-linux-unix","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/20-pmap-commands-examples-in-linux-unix\/","title":{"rendered":"Linux Tutorials: pmap commands examples"},"content":{"rendered":"<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3162 aligncenter\" src=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2015\/12\/pmap-commands-examples-in-l.png\" alt=\"\" width=\"600\" height=\"400\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2015\/12\/pmap-commands-examples-in-l.png 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2015\/12\/pmap-commands-examples-in-l-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>You can find the memory used by a program (process) by looking into \/proc directory or using standard command such as ps or top.<\/p>\n<\/div>\n<div>However, you must calculate all memory usage by hand i.e. add Shared Memory + mapped file + total virtual memory size of the process + Resident Set Size + non-swapped physical memory used by process. So how do you find the total memory used by a process or program under Linux? Use a tool called pmap. It reports the memory map of a process or processes.<\/div>\n<div><\/div>\n<div><strong>To display process mappings, type<\/strong><\/div>\n<div>$ pmap pid<\/div>\n<div>$ pmap 3724<\/div>\n<div><\/div>\n<div><strong>If you want to see the exented format<br \/>\n<\/strong>The -x option can be used to provide information about the memory allocation and mapping types per mapping. The amount of resident, non-shared anonymous, and locked memory is shown for each mapping:<\/div>\n<div><\/div>\n<div>$ pmap -x 3526<\/div>\n<div><\/div>\n<div><strong>If you want to see the device format<\/strong><\/div>\n<div>$ pmap -d 3526<\/div>\n<div><\/div>\n<div><strong>If you do not display some header\/footer lines.<\/strong><\/div>\n<div>$ pmap -q 3526<\/div>\n<div><\/div>\n<div><\/div>\n<div><strong>GENERAL OPTIONS<\/strong><\/div>\n<div>-x extended Show the extended format.<\/div>\n<div>-d device Show the device format.<\/div>\n<div>-q quiet Do not display some header\/footer lines.<\/div>\n<div>-V show version Displays version of program.<\/div>\n<div><\/div>\n<div><strong>Reference<\/strong><\/div>\n<div><a href=\"http:\/\/linux.die.net\/man\/1\/pmap\" target=\"_blank\" rel=\"noopener\">http:\/\/linux.die.net\/man\/1\/pmap<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>You can find the memory used by a program (process) by looking into \/proc directory or using standard command such as ps or top. However, you must calculate all memory usage by hand i.e. add Shared Memory + mapped file + total virtual memory size of the process + Resident Set Size + non-swapped physical&#8230;<\/p>\n","protected":false},"author":1,"featured_media":3162,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[4957],"tags":[378,632,460,1298,1295,1296,1297,1300,1299,169],"class_list":["post-466","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-commands","tag-examples","tag-linux","tag-linux-pmap-command","tag-pmap","tag-pmap-command","tag-pmap-command-examples","tag-pmap-command-line","tag-pmap-commands-tutorials","tag-unix"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=466"}],"version-history":[{"count":4,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/466\/revisions"}],"predecessor-version":[{"id":29688,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/466\/revisions\/29688"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/3162"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}