{"id":5326,"date":"2014-03-30T20:44:03","date_gmt":"2014-03-30T20:44:03","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-with-the-gnu-time-command-to-measure-memory-usage-collection-of-common-programming-errors\/"},"modified":"2014-03-30T20:44:03","modified_gmt":"2014-03-30T20:44:03","slug":"problem-with-the-gnu-time-command-to-measure-memory-usage-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-with-the-gnu-time-command-to-measure-memory-usage-collection-of-common-programming-errors\/","title":{"rendered":"problem with the GNU &ldquo;time&rdquo; command to measure memory usage-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;ve been trying to use the time command \/usr\/bin\/time to measure the peak memory consumption of a program on a linux system. Independently of what executable I experiment with, I get the correct answer for what regards running time, but memory usage figures are always 0.<\/p>\n<p>the typical output from time is something like:<\/p>\n<blockquote>\n<p>8.68user 0.04system 0:08.73elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+16outputs (0major+20366minor)pagefaults 0swaps<\/p>\n<\/blockquote>\n<p>the zeroes which I am not understanding are:<\/p>\n<blockquote>\n<p>0avgtext+0avgdata 0maxresident<\/p>\n<\/blockquote>\n<p>I have googled around, and I gather that GNU time is actually not able to compute those memory usage data which are referred to in its man page. Am I correct? What is an alternative command I could use to the same effect? (without having to exercise valgrind)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been trying to use the time command \/usr\/bin\/time to measure the peak memory consumption of a program on a linux system. Independently of what executable I experiment with, I get the correct answer for what regards running time, but memory usage figures are always 0. the typical output from time is something like: 8.68user [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5326","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5326"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5326\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}