You shouldn't need to gc.collect() in python.  When the instances reference
count goes to 0 then at some point in the future pythons garbage collection
will kick in.  If you are holding onto references then this could account
for the memory bloat.  But if you are patient you might also see python
clean up after itself.

How are you building the UI?  PySide?  Are you using a lot of globals?  How
are you closing and opening the UI?  Are you parenting all you widgets into
the UI?

-Dave


On Tue, Apr 25, 2017 at 2:19 PM, Rudi Hammad <[email protected]> wrote:

> Hello,
> I am developing a rig builder tool for the studio that is quite heavy, and
> after running the UI I checked the garbage collection and I get a result of
> gc.collect() -->322. If I run the UI 3 times, then the gc.collect() -->955
>
> I don“t know much about memory performance so I wonder if  this happening
> because my code is not clean enough or if this normal while programming a
> code with a lot a variables and objects?
> Should I just do gc.collect() at the end of the script to clean things up?
>
> thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/9bc3d18a-5f39-44bf-948c-
> 22c7d7746a86%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/9bc3d18a-5f39-44bf-948c-22c7d7746a86%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*David Moulder*
Technical Animator / Artist
[email protected]
*Professional Profile <http://uk.linkedin.com/pub/david-moulder/1/b12/b5a>*

Mobile: +44 (0)7814033242
See who we know in common
<http://www.linkedin.com/e/wwk/5748982/?hs=false&tok=3tztwkse1silw1> Want a
signature like this?
<http://www.linkedin.com/e/sig/5748982/?hs=false&tok=3pwLU9-mBsilw1>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CABD4PkSVVVODs%2Bxqwd3r4uL6kJo6%2B692x9TShabuGBgUXS3mhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to