Tue, Dec 31, 5:13 PM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: find memory leak?


colorcurvature ( ) posted Wed, 02 November 2011 at 4:47 PM · edited Tue, 05 November 2024 at 7:43 PM

Hi, I noticed memory goes down when I execute my script, and it doesnt return. The more often its executed, the more the memory goes down.

What I did was this:

def _dbg_dump_gc( ):
    #l = []
    #l.append(l)
    gc.set_debug(gc.DEBUG_SAVEALL)
    print gc.collect( )
    print gc.collect( )
    print 'leaks:'
    for i in gc.garbage:
        pprint.pprint (i)
    print 'end of leaks.'
    del gc.garbage[:]

 

but that isnt printing anything except the gc.collect return values, which are 0, unless I decomment that part with an intentional hanging self-referring list.

but that isnt evening printing the global variables. I wonder why. maybe some more flags have to be set?

 

thanks a lot!

col


nruddock ( ) posted Wed, 02 November 2011 at 5:03 PM

I suspect the problem you're running into is due to the fact that all objects you get from Poser are implemented in native code and that the memory is leaking because the underlying allocated memory can't be released by the Python garbage collector.

The only thing you can do is to try using del on large lists, tuples, and arrays allocated via numeric or numpy, to see if you can improve the situation.

It may also be the case that the use of native objects prevent the debugging tools from detecting where leaks are occuring.


colorcurvature ( ) posted Wed, 02 November 2011 at 5:11 PM

Its a bit strange yes. maybe it has to be accepted and put as a limitation into the readme files or manual.


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.