python: reloading script with embedded image increases memory usage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys!
Sorry for the vague title, wasnt really what to call it.
So im fairly new to Python scripting with Maya, and im encountering an issue with my script increasing Mayas memory footprint by hundreds of megabytes every time I reload it.
I've narrowed it down to when I have embedded an image into my layouts, e.g.
cmds.image(image="theimage.jpg")
The image in question is of 4k size, and sits at about 1MB in filesize - but when loading my script this increases the amount of memory maya uses but a huge amount. "reloading" the script with the usual reload() command further increases the memory footprint, and would seemingly continue to do so until I run out
So my question is, is there a way to ensure this doesnt happen? Removing the image stops the problem from occurring, but I have no idea if there's a way to "unload" everything when the UI widow is closed, etc.
Any help would be greatly appreciated!