Loading ...
Sorry, an error occurred while loading the content.

Re: [blug-prog] How to find memory usage at run time

Expand Messages
  • Vishal Soni
    On Mon, 05 Apr 2004 16:16:10 +0530 ... getrusage is handy but is giving me shared mem size/ swap ../time used / messages sent-recv /signals etc. none of the
    Message 1 of 7 , Jan 21, 2004
    • 0 Attachment
      On Mon, 05 Apr 2004 16:16:10 +0530
      Srini Sankaranarayanan <srinivasan.sankaranarayanan@...> wrote:

      > Vishal Soni wrote:
      >
      > > Dear friends,
      > >
      > > In certain part of my code i need to have the overall usage of Physical Memory at run-time.
      > >
      > >
      > >
      > Try "getrusage" defined in <sys/resource.h>. I have not used this hence
      > donno for sure.

      getrusage is handy but is giving me "shared mem size/ swap ../time used / messages sent-recv /signals etc.
      none of the members of the rusage structure gives physical memory used.


      >
      > Srini.

      and as Sanjeev suggested ... something like implementation of top utility shall serve the
      purpose. i am trying to understand that ...

      Vishal
    • Vishal Soni
      On Mon, 5 Apr 2004 18:57:54 +0530 ... Thank you Sunil, You made my Day ... Regards, Vishal.
      Message 2 of 7 , Jan 21, 2004
      • 0 Attachment
        On Mon, 5 Apr 2004 18:57:54 +0530
        sunils@... wrote:

        > On Sun, Apr 04, 2004 at 10:08:19PM +0530, you said.. :
        > =>
        > => the structure and member which writes MemFree in /proc/meminfo.
        > =>
        >
        > man sysinfo

        Thank you Sunil,
        You made my Day ...
        Regards,
        Vishal.
        >
        > Regards,
        > Sunil
      • Vishal Soni
        Dear friends, In certain part of my code i need to have the overall usage of Physical Memory at run-time. I am looking for the structure which writes the
        Message 3 of 7 , Apr 4, 2004
        • 0 Attachment
          Dear friends,

          In certain part of my code i need to have the overall usage of Physical Memory at run-time.

          I am looking for the structure which writes the information in /proc/meminfo

          like when i do

          [vishal@otl027 glibc-2.3.2-200310271512]$ cat /proc/meminfo

          MemTotal: 515616 kB
          MemFree: 474676 kB
          Cached: 25060 kB
          SwapCached: 0 kB

          and so on ...

          I am trying to look into "top" utility's source code , which i got frm procps-3.2.1.tar.gz,

          but has not got much success.

          If anyone happens to use this i.e

          the structure and member which writes MemFree in /proc/meminfo.

          Kindly lemme know, it wud be very helpful 4 me.


          Regards,

          Vishal.
        • Srini Sankaranarayanan
          ... Try getrusage defined in . I have not used this hence donno for sure. Srini.
          Message 4 of 7 , Apr 5, 2004
          • 0 Attachment
            Vishal Soni wrote:

            > Dear friends,
            >
            > In certain part of my code i need to have the overall usage of Physical Memory at run-time.
            >
            >
            >
            Try "getrusage" defined in <sys/resource.h>. I have not used this hence
            donno for sure.

            Srini.
          • Sanjeev B.S.
            ... How about size, ps and top commands?
            Message 5 of 7 , Apr 5, 2004
            • 0 Attachment
              > In certain part of my code i need to have the overall usage of Physical Memory at run-time.

              How about size, ps and top commands?
            • sunils@picopeta.com
              On Sun, Apr 04, 2004 at 10:08:19PM +0530, you said.. : = = the structure and member which writes MemFree in /proc/meminfo. = man sysinfo Regards, Sunil
              Message 6 of 7 , Apr 5, 2004
              • 0 Attachment
                On Sun, Apr 04, 2004 at 10:08:19PM +0530, you said.. :
                =>
                => the structure and member which writes MemFree in /proc/meminfo.
                =>

                man sysinfo

                Regards,
                Sunil
              • Pramod Biligiri
                ... or maybe the source code of man free(1)?? Pramod -- http://www.geocities.com/pramodbiligiri I must have slipped a disk -- my pack hurts!
                Message 7 of 7 , Apr 5, 2004
                • 0 Attachment
                  > sunils@... [Mon, Apr 05, at 6 PM]:
                  | On Sun, Apr 04, 2004 at 10:08:19PM +0530, you said.. :
                  | =>
                  | => the structure and member which writes MemFree in /proc/meminfo.
                  | =>
                  |
                  | man sysinfo

                  or maybe the source code of man free(1)??

                  Pramod

                  --
                  http://www.geocities.com/pramodbiligiri
                  I must have slipped a disk -- my pack hurts!
                Your message has been successfully submitted and would be delivered to recipients shortly.