Page 2 of 2

Re: interesting 32bit nw.js v0.19.2 crashing issue

PostPosted: Tue Jan 17, 2017 3:43 am
by StaticCloud
@Ashley Tested and to confirm:

Turning off preload sound lets the 32-bit version of the game boot up perfectly. But crashes after 2 to 3 hours of gameplay.

Turning on preload sound makes the 32-bit version crash as soon as it starts up.

64-bit builds work either way.

Re: interesting 32bit nw.js v0.19.2 crashing issue

PostPosted: Tue Jan 17, 2017 1:24 pm
by Ashley
Thanks, that confirms it's to do with audio memory management. I must point out turning the "preload sounds" option means you are explicitly telling C2 to load and decompress all sounds in to memory on startup, which if you use a lot of sounds, can be a very great deal. But the fact it doesn't release any and still ultimately crashes is a problem. I'll try and get audio unloading in the next build...

Re: interesting 32bit nw.js v0.19.2 crashing issue

PostPosted: Tue Jan 17, 2017 1:29 pm
by TheRealDannyyy
Ashley wrote:Thanks, that confirms it's to do with audio memory management. I must point out turning the "preload sounds" option means you are explicitly telling C2 to load and decompress all sounds in to memory on startup, which if you use a lot of sounds, can be a very great deal. But the fact it doesn't release any and still ultimately crashes is a problem. I'll try and get audio unloading in the next build...

We're about to release our version of the unloading audio feature, this could maybe make things easier on your end.
However nothing stops you from doing everything by yourself, looking forward to it either way.

Re: interesting 32bit nw.js v0.19.2 crashing issue

PostPosted: Tue Jan 17, 2017 3:27 pm
by TheRealDannyyy
Well here it is @StaticCloud, I hope it fits your needs.
experimental-audioplus-plugin-unloading-audio_t186455

Re: interesting 32bit nw.js v0.19.2 crashing issue

PostPosted: Tue Jan 17, 2017 8:29 pm
by glerikud
Ashley wrote:I'll try and get audio unloading in the next build...

It would be awesome to see it as an official feature. @TheRealDannyyy thank you for your hard work as well.

Re: interesting 32bit nw.js v0.19.2 crashing issue

PostPosted: Wed Jan 18, 2017 3:10 am
by StaticCloud
@TheRealDannyyy Thank you for this, very helpful! Hopefully, will find it`s way into an official update too.

Out of interest how does memory management / garbage collection of video work? - is it like image files with automatic garbage collection on layout change or more like audio? Could we further save ram use by unloading video from ram after viewing?

Re: interesting 32bit nw.js v0.19.2 crashing issue

PostPosted: Wed Jan 18, 2017 5:24 am
by TheRealDannyyy
glerikud wrote:
Ashley wrote:I'll try and get audio unloading in the next build...

It would be awesome to see it as an official feature. @TheRealDannyyy thank you for your hard work as well.

Thanks to BackendFreak, I'm just the "publisher" for this one.


StaticCloud wrote:@TheRealDannyyy Thank you for this, very helpful! Hopefully, will find it`s way into an official update too.

Out of interest how does memory management / garbage collection of video work? - is it like image files with automatic garbage collection on layout change or more like audio? Could we further save ram use by unloading video from ram after viewing?

I've honestly never used the video plugin and I'm using C2 for a couple of years now.
I think memory management for videos is handled by the "destroy" action?

Judging by THIS changelog I assume that destroying the video, unloads the memory used for the playback.
The best way to make sure that it is, is by doing measurements on your end and see if memory usage goes down when destroying the object or changing the layout.