Grimm's take on the turntable anim script

Forum for OctaneRender Lua scripting examples, discussion and support.
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Thanks :D But this shouldn't be necessary as the garbage collector runs automatically. Unless you are doing some extreme memory or table usage, or Octane is interfering with the collection it shouldn't be needed. I will do some profiling but I'm thinking that these scripts don't use enough memory that makes it necessary to force a collection. Maybe Thomas can add his thoughts to this?

Jason
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

You're right Jason, there should be no need to kick the garbage collector from the script. The whole point about garbage collection is to make sure that programmers don't have to worry about this. Garbage collection itself doesn't come cheap either.

Of course, there's nothing against trying to optimize garbage collection for your script. More info on that here.

@gmillas: can you provide me with an example script where you see those big memory spikes?

cheers,
Thomas
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Thanks Thomas,

I ran a simple profile on the turntable script using Octane version 2.01 and these are the results in Kilobytes. All I did was put

Code: Select all

print(collectgarbage("count"))
in the code at various places.

Code: Select all

220.361328125    <- start of the script
281.533203125    <- start of animation preview
312.0107421875  <- cancel of preview
217.806640625    <- start of animation preview again, looks like the garbage collector ran
318.2080078125  <- cancel of preview
348.650390625    <- another animation preview
307.3134765625  <- cancel and maybe another garbage collection
This isn't probably a real good method to do the profile, but it at least give us an idea on what's happening as the script runs.

So, at the most, the memory usage rose up to 348 KBytes of memory but the garbage collector appears to be working as it should.
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
gmillas
Licensed Customer
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece
Contact:

did you run a whole render turntable with 1920x1080 and 400 frames ?

i did that and at 275 memory use of octane.exe was 2 gb ( with not much intesive scene i will post today a screene shot with that...
gmillas
Licensed Customer
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece
Contact:

I dont know if i am doing something wrong but have a look ->
Here tou go : without collectgarbage() -- original grimm script
Screenshot 2014-06-24 10.18.11.png
Screenshot 2014-06-24 10.18.45.png
Screenshot 2014-06-24 10.19.43.png
Screenshot 2014-06-24 10.22.34.png
with collectgarbage()
Screenshot 2014-06-24 10.26.07.png
Screenshot 2014-06-24 10.27.39.png
Screenshot 2014-06-24 10.28.23.png
Screenshot 2014-06-24 10.29.16.png
Attachments
Screenshot 2014-06-24 10.24.45.png
gmillas
Licensed Customer
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece
Contact:

And this memory spikes are always at the render loops ( mine and grimm's ) :?
any thoughts ?
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Hmm, very strange, I have no idea? Thomas? :? I wouldn't think that the Lua garbage collector could affect Octane's memory usage at all? There must be some other mechanism at work here.
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
gmillas
Licensed Customer
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece
Contact:

and if you have a limite of 4GB on your system at some time it would be unsuable ...... no memory on your system ..... :cry:

thoughts :?:

the scene i posted is very simple 5 textures and 4078 tringles ... 4 meshes

nothing exotic ... simple things ....
gmillas
Licensed Customer
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece
Contact:

I have a request .
:idea:

Can you add a render frame selection
from frame -> to frame ?


thanks
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

That's a good idea, I will add that in this weekend. Thanks,

Jason
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
Post Reply

Return to “Lua Scripting”