A tool for measuring memory and time used when executing a command

memtime is a friendly tool for measuring memory usage which is fetched from a PID information of /proc/[PID]/stat by sampling. It is originally written by Johan Bengtsson in 2002.
It can be found in or
But there are some limits or bugs when running in 32 bit linux platforms. Because there are overflows
   - does not allow/report more than 4GB memory usage
   - does not allow runs of longer than 21666 seconds
We have found that unsigned int is used as a counter among the programs which is a upper limit for memory and runtime measuring when run on 64 bit linux platforms. So we fix this by using long int as a counter which can allow us to measure more than 4GB memory usage and 21666 seconds.


Jianlei Yang, EDA Lab of Tsinghua University, jerryyangs AT
Zuowei Li, EDA Lab of Tsinghua University, lizuoweirain AT

Download memtime-1.3.tar.gz

1. Download the package and then unpack it by
   tar zxvf memtime-1.3.tar.gz
   You will get the directory memtime-1.3 and then make

2. The binary file memtime can be used by this format:
   ./memtime <command>
   <command>: The command to be measured
   For an example:
   ./memtime ./main

Tool: memtime
Authors: Zuowei Li, Jianlei Yang

June 1st, 2012
Tsinghua Design Automation


Created: 01/06/2012, Last Update: 01/06/2012 16:34:50
By Jianlei Yang, All rights reserved.