Solved

system call -rusage

Posted on 2009-05-07
2
260 Views
Last Modified: 2012-05-06
hi,

could anyone pls help?i am using getrusage to get the max memory use and it is returning o..
this is the code:

      struct rusage usage;
      getrusage (RUSAGE_SELF, &usage);
      fprintf(stderr,"Memory Usage : %ld",usage.ru_maxrss);
thanks a miilion.
0
Comment
Question by:zizi21
2 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 500 total points
ID: 24332486
ru_maxrss and other members are not implemented on Linux.

From the man page:

      The above struct was taken from 4.3BSD Reno.  Not all fields are meaningful under Linux.  In linux 2.4 only the
       fields  ru_utime,  ru_stime,  ru_minflt, and ru_majflt are maintained.  Since Linux 2.6, ru_nvcsw and ru_nivcsw
       are also maintained.
0
 

Author Closing Comment

by:zizi21
ID: 31579282
Thanks a million
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now