How to limit RAM usage (Rhino 6)?

Hi,

I have a little problem with Rhino and the ram of the computer when i run a script. So, in the beginning i had 8 gig of ram and Rhino was using all of it. Because Rhino 6 can use up to 8 gig (i think), i installed more ram. Right now i’m at 32 and Rhino use 18 of them…

Is there any way to limit the ram Rhino use? I don’t have that problem with the same code on other computers. The only difference is that they have Rhino 5 instead of 6.

Thank you

Hi @davedufour1991,

Would it be possible for you to send us the file and the script, or are they too large? We would like to take a look at it to see what’s going on. You can send the file here https://www.rhino3d.com/upload. Put david.eranen@mcneel.com in the recipient field.

-David

@davedufour1991,

I tested the script that you sent on both Rhino 5 and 6. In both cases my total memory was eventually filled up and I decided to kill the process. Rhino used around 11 GB of RAM. I will need to assign this issue to someone who has a lot more RAM so that they can do a fair comparison.

Edit: I don’t know of any way to limit RAM usage in Rhino 6.

-David

What is your Undo memory limit? Tools -> Options -> General -> Undo: Max memory used. If it’s very large, try reducing it and see if you notice any difference.

-David

Hi,

Thank you for your help!

The undo limit is of 256 MB, but it look like it is not really working. However, that gave me an idea and to solve the problem i added the ClearUndo command in my script. It is working well, but it is strange that the Tools -> Options -> General -> Undo option have no impact.

  • Dave

@davedufour1991,

That’s good news. I think the Undo Limit is only enforced after the script ends. A workaround is doing ClearUndo. Thanks to @nathanletwory for suggesting the Undo limit thing to me!

@davedufour1991 - can tell me if you’re doing in the script other than trying to make the most compact stack possible? (I found it a bit hard to parse…)

Dave, just assuming the simplest, here’s a script that will do some stacking - it may or may not be what you need but one thing that is does that you might want to play with is jiggle the meshes in memory and not as objects in the file i.e. I extract a copy of the mesh and move it around until it’s in in its final position - however lame that may be in my code - and then add it back to the document, replacing the original. This avoids racking up tons of memory and Undo.

Incidentally, in testing your script here, it eventually finished using ~21+ GB on 6 and ~22 on v5.

-Pascal

Hi Pascal,

The code is only used to make the stack more compact before a 3D printing to optimize the number of pieces produced in a certain volume of powder. The more we make, the better it is.

Damn! That thing is fast! There is definitely something i can do with that code to upgrade what i did. I just need to figure how to insert the tolerance i need!

Thank you for sharing it!

  • Dave

Hi Dave - I added a line -

image

Which I had in there at some point - I’m not sure why I took it out. but if you put that back in, it will move each mesh up a bit before adding it to the document. The amount is set up near the top where vecTemp is defined. That may where you put in your tolerance.

-Pascal

Hi Pascal,

Yes this is working! Now i just need to play with it a bit for it to be perfect.

In the code i was using, i was comparing every points to measure the smallest distance between the mesh of two obects (That part is time consuming) to be able to move them the closest possible (0.5 mm) from each other using vectors, based on the closest points.

Thank you for the help

-Dave