SketchUp RAM usage, can i free it?

Hey!
(using sketchup 2024)

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:

  1. User has panel in 3D representation
  2. User change it to 3D Bounding box representation
  3. Plugin destroys 3D representation and creates Bounding Box representation
  4. User change it back to 3D representation,
  5. Plugin destroys current representation and draw full details representation
    Etc. etc.

It looks like this:

The issue:
After few visualization changes, the RAM is only increasing, for example:

start usage:
image

After 10 change of visualization:
image

Even if I delete this groups from the scene, the memory don’t decrease

the worst part of this is the Mac systems. We have users who tells as that SketchUp eating their memory ;/

Any help to solve it?
Only working way which I know is to close/open Sketchup

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.

there was a massive memory leak in one of the recent Os, with people (on various applications) showing similar screenshots as you do right now.

the solution was to manually purge RAM using solutions like memory clean

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.

I might instead call it one of these:

  • Enclosure
  • Periphery
  • Shell

What do other readers think ?

1 Like

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.

1 Like

I agree. The usage was unclear and ‘Bounding Box’ has a different meaning (at least how I interpret it).

  • Envelope
  • Container
  • Outer/Inner
1 Like

Unfortunately the user reported that issue on Sketchup 2025 ;/

if you want I can give you reproduce steps todo it on mac if SketchUp Team would like to debug it more

It might be useful if you can share the file , someone here will be able to see if there is something else awry that might be causing an issue.

One experience that is super common with troubleshooting mac users is that they rarely close SketchUp and they have multiple documents open simultaneously because they never close the application.
I’ve seen similar things where it turned out they actually have 15 sketchup documents open.

1.3gb for the windows version looks about right for any normal SketchUp file - I’ll have about 800 with an empty file.
SketchUp’s minimum requirements are are for 4GB.

the 94GB of memory on the Mac is concerning, although it will report differently as that is also counting virtual and GPU memory there.

Could it be the sketchframer itself causing an issue, are you running the latest version of that? 1.5.92

Thanks for answer!

sharing the file is useless, because the issue disappeared when sketchup is reset.
After open the memory usage reset and it is again low RAM (300-1000MB)
But I can prepare file to be opened with our plugin with reproduce steps.

Basically is to draw a lot of wall (100?, they can be copied in sketchup)
and change a visualization few times. For example by toggle this buttons


The plugin is free to download at https://www.sketchframer.com/

Could it be the sketchframer itself causing an issue, are you running the latest version of that? 1.5.92

I am programmer behind sketchframer:P
These issues are from our users.
Unfortunately I don’t have mac device to test it myself.

Yes, I think it is because of our plugin like I said in first post in this issue :wink:

1 Like

haha gotcha

It’s a neat plugin!

1 Like

As they are on Mac, I’d also make sure they are actually running SketchUp from the applications folder.

All kinds of weird stuff happens when users somehow ignore the installation instructions and then do the more complicated thing of running them from the mounted drive image on their desktop.

On a side note (I don’t know if this will help you find the problem or is another bug altogether) , after installing Sketchframer on Windows and closing down. Opening any new templates look like this - Axes is turned off and the aligner is present.

The first time I saw this I tried to open the default tray (so I could use entity info) and it crashed SketchUp.

The extension seems to impose its own Style on any template you open. You can change that back to the default style if you like.

I do see memory increasing a lot when I make 100 walls and click on the first C button. That was enough to make it be 55 GB with SketchUp 2025. Same test in SketchUp 2024 ‘only’ went up to 8.8 GB.

correct!

;/
Any solutions?
Like I mention before, during change of ‘visualization’ we do like this:
so each time we clear all entities for a group and make a new ones.

  def draw()
    @group.entities.clear!

    case @visualization_mdoe
    when FULL_3D
      draw_full_3d
    when SIMPLE_GEOMETRY
      draw_simple_geometry
    when BOUNDS
      draw_bounds
    end
  end

This is terribly inefficient. You also are not using an undo operation, (that I can see.)

Update about this…

I did log an internal bug report (SKEXT-4662 in our system), so that someone can check into whether there is a problem on our side of things.

1 Like

This is terribly inefficient. You also are not using an undo operation, (that I can see.)

do not worry, we have these operation closed in operations. You can test it by you own with plugin (after change of visualization you can undo/redo it)

I did log an internal bug report (SKEXT-4662 in our system), so that someone can check into whether there is a problem on our side of things.

super!

Yes, but after each “vizualization”, do you call Sketchup::undo to “clean up” the undo stack ?


As an aside, have you considered just switching off the tag-layer that the frame is assigned to, and drawing the shell using a Sketchup::Overlay ?

Haha, i mean:
we have these operation closed in SKETCHUP operations*
So yes, users can undo them without problem.

Sorry, don’t understand point of this. User can also do something like: change visualization, do some operations and later change visualization to previous one.
So that solution won’t work in this case.

oh, never tried this before, will check it more deeply.
Thanks for the suggestion!
Unfortunately it is for sketchup 2023+
Some % of our users use older version :frowning:

Yes, but those on a newer version should not be held back.

:thinking: