Solved

system call -rusage

Posted on 2009-05-07
2
262 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

830 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