Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

time builtin vs. time(1): difference in memory numbers



zsh-4.3.10_4, FreeBSD 9.0-CURRENT r216095M amd64

I'm a bit puzzled by...

- numbers for shared/unshared space don't match those from `time -l'
- zsh manual page claims that %M stands for memory in Kbytes while it
  displays them in Mbytes

Do %X/%D/%K/%M display consistent numbers on Linuces or other BSDs?

$ tcsh -f
% set time=(3 "%X shared %D unshared %K total %M maxres")
% time xz -c /COPYRIGHT >/dev/null
52 shared 3148 unshared 3200 total 8132 maxres

$ zsh -f
% TIMEFMT="%X shared %D unshared %K total %M maxres"
% time xz -c /COPYRIGHT >/dev/null
6953 shared 420930 unshared 427883 total 17 maxres

$ command time -l xz -c /COPYRIGHT >/dev/null
        0.02 real         0.00 user         0.02 sys
     17220  maximum resident set size
        78  average shared memory size
      3032  average unshared data size
       192  average unshared stack size
      4386  page reclaims
         0  page faults
         0  swaps
         0  block input operations
         1  block output operations
         0  messages sent
         0  messages received
         0  signals received
         1  voluntary context switches
         1  involuntary context switches

time(1) is close to ps(1) and STATUS (^T) in numbers about resident size.
Not sure why maxres (%M) is halved for tcsh.



Messages sorted by: Reverse Date, Date, Thread, Author