Hi everyone! I'm trying to build a gui for an asset-browser for maya. Im using pyqt and trying to learn how models and qListviews work. Now I have come to the loading of thumbnails which is a bit troublesome. I have something that works like this: - A list of files, in this case just thumbnail paths. - I then put these paths into a custom object class which stores all my data in a hierarchical tree structure. - I then put this nodeTree into a QAbstractItemModel and using the DecorationRole to display my thumbnails in the connected qListview. The problem is that I load these images from a network location so this process of populating the thumbnails in the listview takes awhile. I also scale my thumbnails which also takes a fair amount of time.
To speed thing up I decided to have a look at QThread. So instead of loading and manipulating my images in the decorationRole I do so in a separate thread. I then pass the finished loaded and scaled image as a qImage into my hierarchical tree structure. As the nodeTree updates the model gets updated and my decorationRole catches my newly created qImages and displays them. So everything works fine, the thumbnails loads quick and everything updates as expected. The only problem I have is that Maya allocates almost 500mb of memory when all thumbnails are loaded, there are like 100 of them for now. I can live with that memory footprint but what I'm more concerned with is that it doesn't release this memory when I close my window. And if I run my script again and open a new window I get another 500mb allocated. For every time I start my application it increases the ram-usage by roughly the same amount. How can I make maya release all objects and thumbnails from memory when I close my script? Is this a memory leak or is the this behaviour expected? If you have any clue of whats going on or what to do it would be highly appreciated! thanks /Erik -- 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 post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
