I wonder if there is a way to free up sketchup memory during the usage.
I’m working on ‘SketchFramer’ Plugin, in short it’s plugin to create building from steel profiles. Each panel is uniq group and has a lot of parameters saved inside group.
We have a option to change ‘visualization’ from 3D full details into 3D bounding box representation. It’s working like this:
User has panel in 3D representation
User change it to 3D Bounding box representation
Plugin destroys 3D representation and creates Bounding Box representation
User change it back to 3D representation,
Plugin destroys current representation and draw full details representation
Etc. etc.
From experience, I think that SketchUp does not recycle memory to the system until it closes. It “ high water mark”s. There is no way to force memory release from within SketchUp.
That said, such vast consumption of memory says your code is doing something excessive. Without seeing an example model or the code, I can’t say what.
For starters, check the “show nested components” box in model info. The model might have a lot more content than you realize. The fact that there is only one group and no component instances suggests that you are generating very large amounts of geometry, or perhaps hanging onto a very large number of Ruby objects, a large data store, or similar.
Perhaps save the model, open a new empty model, (on Mac close the working model document window,) then reopen the working model.
You can also execute GC.start to have Ruby do a round of garbage collection.
Groups are really “special” component instances that do not appear in the Components inspector listing. Therefore, the geometry for group instances is contained within the Entities collection of a ComponentDefinition.
If your code does not also purge the DefinitionList collection, when you delete the group instances, then the group geometry will still be held within the model database. So be aware of the component definition count as your extension does it thing.
I disagree that “bounding box” is a good term for this. A bounding box has specific meaning in SketchUp and its “surfaces” have no thickness as they are a boundary.
We did fix one or two issues where memory use would keep on increasing. It would be worth having your customers try 2025, to see if the memory stays lower.