Grimm's take on the turntable anim script

Forums: Grimm's take on the turntable anim script
Forum for OctaneRender Lua scripting examples, discussion and support.

Re: Grimm's take on the turntable anim script

Postby grimm » Mon Jun 23, 2014 4:48 pm

grimm Mon Jun 23, 2014 4:48 pm
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 19 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 440.64
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1257
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Grimm's take on the turntable anim script

Postby stratified » Mon Jun 23, 2014 8:20 pm

stratified Mon Jun 23, 2014 8:20 pm
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
stratified
OctaneRender Team
OctaneRender Team
 
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Re: Grimm's take on the turntable anim script

Postby grimm » Tue Jun 24, 2014 4:37 am

grimm Tue Jun 24, 2014 4:37 am
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 19 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 440.64
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1257
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Grimm's take on the turntable anim script

Postby gmillas » Tue Jun 24, 2014 7:11 am

gmillas Tue Jun 24, 2014 7:11 am
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
Licensed Customer
 
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece

Re: Grimm's take on the turntable anim script

Postby gmillas » Tue Jun 24, 2014 7:58 am

gmillas Tue Jun 24, 2014 7:58 am
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
Licensed Customer
 
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece

Re: Grimm's take on the turntable anim script

Postby gmillas » Tue Jun 24, 2014 8:04 am

gmillas Tue Jun 24, 2014 8:04 am
And this memory spikes are always at the render loops ( mine and grimm's ) :?
any thoughts ?
gmillas
Licensed Customer
Licensed Customer
 
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece

Re: Grimm's take on the turntable anim script

Postby grimm » Tue Jun 24, 2014 8:22 am

grimm Tue Jun 24, 2014 8:22 am
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 19 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 440.64
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1257
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Grimm's take on the turntable anim script

Postby gmillas » Tue Jun 24, 2014 8:41 am

gmillas Tue Jun 24, 2014 8:41 am
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
Licensed Customer
 
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece

Re: Grimm's take on the turntable anim script

Postby gmillas » Wed Jun 25, 2014 10:31 am

gmillas Wed Jun 25, 2014 10:31 am
I have a request .
:idea:

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


thanks
gmillas
Licensed Customer
Licensed Customer
 
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece

Re: Grimm's take on the turntable anim script

Postby grimm » Fri Jun 27, 2014 6:28 am

grimm Fri Jun 27, 2014 6:28 am
That's a good idea, I will add that in this weekend. Thanks,

Jason
Linux Mint 19 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 440.64
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1257
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA
PreviousNext

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 6 guests

Thu Jul 02, 2020 9:47 am [ UTC ]