Memory issue with SetPosition of Sun


#1

I have the very simple following script

import scriptcontext as sc
import System.DateTime as dt

theSun = sc.doc.Lights.Sun
theSun.Enabled = True
startingDate = dt(2014, 1, 1, 0, 0, 0)
for i in range(0, 365*24, 1):
theSun.SetPosition(startingDate.AddMinutes(i),
theSun.Latitude,
theSun.Longitude)

Before running this script, the process of Rhino.exe use 390,312 K. After it’s at 991,040 K ! Running it again and it’s 1,592,208 K.
It’s going up and never down. Can anyone explain me why and what to do?

Thanks.


(Dale Fugier) #2

@andy, what do you make of this?


#3

I am not sure I understand the question.
I just open the editor with ‘EditPythonScript’, copy these few lines in it and run it. It doesn’t change anything if I’m using the run without debug or the reset engine and debug.
Don’t you have the same issue than me?


(Willem Derks) #4

Hi Serge,

Dale replied with the “@andy” so he (Andy) will be informed via an automated message about this issue.
Andy is the developer at McNeel responsible for many things Renderer related. He is most likely to be able to test the issue and find the bug or cause and tell you what he found.

-Willem


(Andrew le Bihan) #5

I’ve been examining the problem today. It is a bug in Rhino that needs to be fixed. However…

What’s basically happening here is that you are modifying something over and over again - hundreds of times - within the same script. This causes a giant amount of information to be placed into the undo stack. That’s what you’re seeing.

The bug is that when you type “ClearUndo” this is not actually released back to the system memory. You will notice, however, that if you type “ClearUndo”, and then run the script a few times again, the memory doesn’t grow until you get to the point that the undo stack is bigger than last time.

I will ensure that this bug is fixed as soon as possible.


(Andrew le Bihan) #6

This is issue RH-24032


#7

Thank you.