Memory stats

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tarek Ziadé

    #1

    Memory stats

    Hi list,

    I am trying to find a general memory profiler that can measure the
    memory usage in Python program
    and gather some stats about object usages, and things like that.

    I am trying to find a simple python module to be able to customize it
    and integrates it to other tools i have.
    (it should exists i guess)

    Thanks,

    Tarek

    --
    Tarek Ziadé, Nuxeo R&D (Paris, France)
    CPS Platform : http://www.cps-project.org
    Zope3 / ECM : http://www.z3lab.org
    mail: tziade at nuxeo.com; tel: +33 (0) 6 30 37 02 63

  • Diez B. Roggisch

    #2
    Re: Memory stats

    Tarek Ziadé wrote:[color=blue]
    > Hi list,
    >
    > I am trying to find a general memory profiler that can measure the
    > memory usage in Python program
    > and gather some stats about object usages, and things like that.
    >
    > I am trying to find a simple python module to be able to customize it
    > and integrates it to other tools i have.
    > (it should exists i guess)[/color]

    Try the gc-module. It's a no-brainer to compute a class histogram. I
    once even wrote my own Qt-based analyzer - maybe I'll release it one day :)

    Diez

    Comment

    • Martin v. Löwis

      #3
      Re: Memory stats

      Tarek Ziadé wrote:[color=blue]
      > I am trying to find a general memory profiler that can measure the
      > memory usage in Python program
      > and gather some stats about object usages, and things like that.[/color]

      As Diez says, use gc: gc.getobjects() gives you all container objects.
      If you want a list of all objects (container or not), you have to
      compile a debug build of Python.

      Regards,
      Martin

      Comment

      • Martin v. Löwis

        #4
        Re: Memory stats

        Tarek Ziadé wrote:[color=blue]
        > I am trying to find a general memory profiler that can measure the
        > memory usage in Python program
        > and gather some stats about object usages, and things like that.[/color]

        As Diez says, use gc: gc.getobjects() gives you all container objects.
        If you want a list of all objects (container or not), you have to
        compile a debug build of Python.

        Regards,
        Martin

        Comment

        • gene tani

          #5
          Re: Memory stats

          linux:


          Martin v. Löwis wrote:[color=blue]
          > Tarek Ziadé wrote:[color=green]
          > > I am trying to find a general memory profiler that can measure the
          > > memory usage in Python program
          > > and gather some stats about object usages, and things like that.[/color]
          >
          > As Diez says, use gc: gc.getobjects() gives you all container objects.
          > If you want a list of all objects (container or not), you have to
          > compile a debug build of Python.
          >
          > Regards,
          > Martin[/color]

          Comment

          • Tarek Ziadé

            #6
            Re: Memory stats

            Martin v. Löwis wrote:
            [color=blue]
            >Tarek Ziadé wrote:
            >
            >[color=green]
            >>I am trying to find a general memory profiler that can measure the
            >>memory usage in Python program
            >>and gather some stats about object usages, and things like that.
            >>
            >>[/color]
            >
            >As Diez says, use gc: gc.getobjects() gives you all container objects.
            >If you want a list of all objects (container or not), you have to
            >compile a debug build of Python.
            >
            >Regards,
            >Martin
            >
            >[/color]
            Ok thanks,
            I am amazed not to find an existing implementation for this.

            Regards
            Tarek

            --
            Tarek Ziadé, Nuxeo R&D (Paris, France)
            CPS Platform : http://www.cps-project.org
            Zope3 / ECM : http://www.z3lab.org
            mail: tziade at nuxeo.com; tel: +33 (0) 6 30 37 02 63

            Comment

            • Tarek Ziadé

              #7
              Re: Memory stats

              gene tani wrote:
              [color=blue]
              >linux:
              >http://aspn.activestate.com/ASPN/Coo.../Recipe/286222
              >
              >[/color]
              Yes thanks I have found this one, I need to try it out,
              but it does not provide a way to refcount,

              Another solution could be to use trace maybe

              I am going to try things out

              Regards

              Comment

              • Stephen Kellett

                #8
                Re: Memory stats

                In message <mailman.912.11 27609812.509.py thon-list@python.org >, Tarek
                Ziadé <tziade@nuxeo.c om> writes[color=blue]
                >I am trying to find a general memory profiler that can measure the
                >memory usage in Python program
                >and gather some stats about object usages, and things like that.[/color]

                Not a Python module, but Python Memory Validator may fit the bill. No
                data on the website, just go straight to the beta page and select the
                product. Windows NT/W2K/XP/etc..

                Software tools for code coverage, memory leak detection, performance profiling, deadlock detection, execution tracing. C++, C, C#, VB6, Delphi




                Stephen
                --
                Stephen Kellett
                Object Media Limited http://www.objmedia.demon.co.uk/software.html
                Computer Consultancy, Software Development
                Windows C++, Java, Assembler, Performance Analysis, Troubleshooting

                Comment

                • Fredrik Lundh

                  #9
                  Re: Memory stats

                  Tarek Ziadé wrote:
                  [color=blue][color=green]
                  > > If you want a list of all objects (container or not), you have to
                  > > compile a debug build of Python.[/color]
                  >
                  > I am amazed not to find an existing implementation for this.[/color]

                  the debug build is an existing implementation, of course.

                  </F>



                  Comment

                  Working...