Dynamic Components and Garbage Collection

I have noticed that when running some batch operations on a number of Dynamic Components, that after the operation is completed, and the UI is up to date, SketchUp really slows down and the CPU usage is ~100% for several minutes (depending on the number of components involved).
I am wrapping this in a start_operation block, with UI updating disabled.

Does anybody know how to find out what is causing this? Could it be the Ruby Garbage Collection running, or does DC invoke some kind of cleanup process after doing lots of redraws?
I think in particular it is related to swapping component definitions for newer ones, thus creating a number of redundant component definitions in the model. The script is not automatically purging the definitions as some that are still required may be lost.

If SU working for several minutes on something it might be that you experience AutoSave kicking in. Does it happen with AutoSave off?

1 Like

There are 2 DC undo methods. Normally a coder uses the #redraw_with_undo which will begin it’s own operation. I am not sure if this one will transparently attach itself to previous operations.