Page MenuHome

Cloth-Sim eats RAM like nothing (on selection change)
Confirmed, NormalPublicKNOWN ISSUE


System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 418.96

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: rBf6cb5f54494e
Worked: (optional)

Short description of error
A simple cloth-sim with a blanket of less than 2.000 vertices.
The RAM-consumption goes up from ~1GB to 25GB and beyond.

Exact steps for others to reproduce the error

  • Open
  • Play animation
  • While animation is playing, keep selecting different objects.
  • Watch the memory usage increase with every click in Blender's status bar.

Deleting cache of cloth-sim doesn´t remove the problem.

Event Timeline

Stephen Swaney (stiv) lowered the priority of this task from 90 to 30.Aug 27 2019, 5:57 PM

Do you have a .blend showing the problem?

yeah, updated the description

Stephen Swaney (stiv) raised the priority of this task from 30 to 90.Aug 27 2019, 11:46 PM
Philipp Oeser (lichtwerk) lowered the priority of this task from 90 to 50.Aug 28 2019, 8:16 PM

Can actually confirm.
Easier way to reproduce for me:

  • open the file
  • hit play
  • constantly switch from selecting the empty, then the blanket, then the empty, ..., keep playing that game
  • each time selection changes I can see memory (displayed in blender as well as real OS monitoring thingie) rise [for me this stop at ~2.3GB though]
  • still weird, a whole run of the simulation [without switching selection back and forth] is only about 25MB
Philipp Oeser (lichtwerk) renamed this task from Cloth-Sim eats RAM like nothing to Cloth-Sim eats RAM like nothing (on selection change).Aug 28 2019, 8:17 PM

yeah you are right. selection change is the important thing.
Yeah it stops somewhere. But if i delete the cache of the cloth sim, it starts again to rise. It´s not so heavy in the demo file.
The original file is like 2GB when packed, i wasn´t sure putting that up. But there is no other cloth or physics sim anywhere else.

I can still bring the cloth.blend to 20GB in 5min. But with my bigger file it get´s there way quicker.
One selection change, makes up to 900mb of RAM.

It seems to have something to do with the undo buffer. Set a memory limit to the undo system (by default it's unlimited) and you'll see it doesn't grow beyond that limit any more.

Jeroen Bakker (jbakker) changed the subtype of this task from "Report" to "Bug".Feb 4 2020, 11:08 AM

The cloth evaluation should not be stored in the undo system. I am not an expert on the solution, but would register this as a bug.

Sebastian Parborg (zeddb) changed the subtype of this task from "Bug" to "Known Issue".Mar 12 2020, 12:14 PM

I talked to Bastien about this and solving this will not be trivial.
We would need to make cloth cache invalidation smarter so that it would known when an undo step would invalidate the cache.

The lazy alternative would be to always invalidate that cache on undo. But that would mean that no matter what you do, as soon as you undo, all the cloth caches in the file would be invalided and you would have to build up the cache for them again.

This will most probably also not be worked on/solved in the next 6 months so I'm marking this as a known issue.