Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm trying to measure the maximum memory used by a process. This is a process which I know to be very memory intensive. However, "time" always reports the memory usage as ZERO. Using "time" with other commands yields the same result. An example is listed below.
Why would this be? Why can't I measure the memory usage?
me@eon $ /usr/bin/time -v date
Sat Jan 3 10:03:10 PST 2009
Command being timed: "date"
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 0%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.01
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 0
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 185
Voluntary context switches: 8
Involuntary context switches: 1
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
Not all resources are measured by all versions of Unix, so some of the values might be reported as zero. The present selection was mostly inspired by the data provided by 4.2 or 4.3BSD. GNU time version 1.7 is not yet localized. Thus, it does not implement the POSIX requirements.
So it would appear that my version of Linux does not support measuring the memory via "time". Is there another way? Another utility to measure memory usage? I want to see the maximum memory used.
Linux doesn't keep any performance/monitoring stats worth spit. You'll need to track the instantaneous usage by sampling /proc for the appropriate numbers. Can be done easily enough, but collectl (or maybe sysstat) is probably the best bet for maintaining historical data.
Still requires you to determine the max usage, but at least you'll have some data to work with.