ndee85 / coa_tools

COA Tools is a 2D Animation Suite for blender. It offers a 2D cutout animation workflow similar to programs like spine or spriter.
GNU General Public License v3.0
908 stars 139 forks source link

Switching collections leaks memory #37

Closed IBwWG closed 8 years ago

IBwWG commented 8 years ago

On or before https://github.com/ndee85/coa_tools/commit/eab992621bc434532d5c253e495bb523f1ec9e17 with blender 2.77a win7sp1x64.

These are single clicks, although maybe related to #35?

ct-mem-leak

IBwWG commented 8 years ago

(It's possible this was an old bug. I've always had to restart blender once in a while--I've only been using blender with coa_tools--because of memory leaks, but I hadn't realized when exactly they were occurring. This seems to be one of the bigger ones.)

ndee85 commented 8 years ago

Ok.. I'll have found a bug when adding keyframes for multiple sprites at once resulting in not proper action naming. I don't know if this may be the case or not. Please try out latest version, just pushed something. If this doesn't help, please provide a test blend where the problem occurs. I cannot reproduce it on my side.

IBwWG commented 8 years ago

OK thanks!

IBwWG commented 8 years ago

Nope, still leaking here. Note this one is not about naming, just about switching, with a single click.

IBwWG commented 8 years ago

Can I e-mail you my project?

ndee85 commented 8 years ago

yes.. Email to andreasesau [at] gmail.com

IBwWG commented 8 years ago

Here, I can even just e-mail you the test with the sprites that I made for #35.

It's interesting to note, in this test one, a single click to switch collections leaks 17 MB, and a double-click to try to rename seems to register as two single clicks, because then it leaks twice as much.

IBwWG commented 8 years ago

Or maybe you're able to reproduce it with such a simple repro case? I can't imagine that it has anything to do with my specific 4 MB of sprite sheets. :)

I'll copy over from the dupe thread...Here it is:

  1. fresh file
  2. import my four sprite sheet files (totaling 4 MB) using coa_tools Import Sprites
  3. create new collection with coa_tools + icon
  4. double click NewCollection

Every time you do that fourth step, it doesn't let you rename, and leaks 35 MB.

If you create a second collection and switch back and forth between the two, each click leaks 17 MB.

ndee85 commented 8 years ago

what about renaming with ctrl+click on the name? Double click will also set the index of the anim collection. This will reassign all actions, this may cause the lag?! For me I cannot notice any memory leaks.

IBwWG commented 8 years ago

Ctrl+click works great! Thanks, that's a super workaround. (I'm a blender n00b still, and apparently will be for a while, there are so many shortcuts and things to learn.) But that only fixes the rename and not the switching leak. So you put in 4 MB of sprites and don't have a 17 MB leak on switch? OK then I will e-mail my sprite sheets to you...

ndee85 commented 8 years ago

So it seems it has nothing to do with renaming, but rather with switching/assigning actions. Then I'll close the rename issue and we keep this open for further discussion.

IBwWG commented 8 years ago

Already done :)

IBwWG commented 8 years ago

Maybe it's an OS difference, are you on Linux?

ndee85 commented 8 years ago

ok.. I took a look at it.. I have to say, I don't know if this is even a bug, or usual blender behavior. When adding a few textures to a texture slot, and selecting the textures results also in increasing the usage of memory space. I don't think I can do something there...

IBwWG commented 8 years ago

So...selecting textures multiple times should eventually run out of memory? If it's usual blender behaviour, I'd say it's a blender bug, then...

IBwWG commented 8 years ago

Like clicking back and forth between two collections continually leaks memory on every click. It's not like after you've selected each collection once, it stops leaking for selecting that particular collection. In the case of my (not overly complicated) project, this means I get < 10 switches max (even just between two collections, no more) before blender has used up all the memory it can on my system, and grinds to a halt.

IBwWG commented 8 years ago

Anyway many thanks for taking a look.

ndee85 commented 8 years ago

I would say blender will free the memory from time to time... Maybe this is done that way for proper undo behavior and maybe other internal functionality.

IBwWG commented 8 years ago

Guess I just need a better system then :( oh well, maybe some day...