bugGNU Time - Bugs: bug #49921, wrong value of maximum resident...


bug #49921: wrong value of maximum resident set size

Submitter:  None
Submitted:  Fri 23 Dec 2016 05:55:05 PM UTC
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

Fri 23 Dec 2016 05:55:05 PM UTC, original submission:  

The field "maximum resident set size" returns a wrong value as reported at:

The following patch seems to work:

diff -ru time-1.7.orig/ChangeLog time-1.7/ChangeLog
--- time-1.7.orig/ChangeLog        1996-07-11 10:37:20.000000000 -0600
+++ time-1.7/ChangeLog        2010-10-01 16:03:09.000000000 -0600
@@ -1,3 +1,10 @@
+2010-10-01  Bob Proulx  <b...@proulx.com>
+        The struct rusage reports ru_maxrss in kbytes not pages and
+        should not be converted through pages-to-kbytes again.
+        Reported by Sven Hartrumpf.
+        * time.c (summarize): Do not call ptok on ru_maxrss.
diff -ru time-1.7.orig/time.c time-1.7/time.c
--- time-1.7.orig/time.c        1996-06-13 13:38:21.000000000 -0600
+++ time-1.7/time.c        2010-10-01 15:49:11.000000000 -0600
@@ -392,7 +392,7 @@
                        ptok ((UL) resp->ru.ru_ixrss) / MSEC_TO_TICKS (v));
             case 'M':                /* Maximum resident set size.  */
-              fprintf (fp, "%lu", ptok ((UL) resp->ru.ru_maxrss));
+              fprintf (fp, "%lu", (UL) resp->ru.ru_maxrss);
             case 'O':                /* Outputs.  */
               fprintf (fp, "%ld", resp->ru.ru_oublock);



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.


No changes have been made to this item

Back to the top

Powered by Savane 3.13-4448.
Corresponding source code