CloseMovie not freeing up ram

Blitz3D Forums/Blitz3D Beginners Area/CloseMovie not freeing up ram

fox95871(Posted 2009) [#1]
I'm having doubts about CloseMovie actually freeing movies from ram. For one thing, you may notice only the notes in the example actually say it's freeing it, the description itself just says it's closing it, which is vague. Also, a little testing shows it may not be getting freed. If you use DrawMovie without first using OpenMovie, Blitz crashes because the file's not in memory yet. But, if you do load it, play it, and press a key to use CloseMovie, then hit play again, it doesn't crash! So it's still in memory, right? I want to be sure about this, not have my in game movies keep piling up as you play longer and longer.


_PJ_(Posted 2009) [#2]
Seems to act differently from normal file/streams then.
I would suggest maybe FreeEntity but that may not work with Movies :(


fox95871(Posted 2009) [#3]
If that's the case, then what would be a way to check the amount of ram Blitz is using? I mean if the movie's just loaded and not playing.


jfk EO-11110(Posted 2009) [#4]
As far as I know there is no memory leak with CloseMovie. I think I remember there was one, but it was fixed. Like with other things too (eg. Meshes), you may free an entity and then it's still there in memeory, even usable. But once freed, it is ready to be overwritten by Directx, so even if it's still usable, it's absolutely unsave and will be overwritten the sooner or later.

To check if there is a memory leak, you only have to start a testapp many times and watch the systems free RAM. If it stays constant, no matter how many times your app is started then there is no leak. You may also run a test app that is opening, playing and closing a movie continously, then watch the Systems Ram and see it it shrinks. (Tho, some shrinking may be caused by RAM fragmentation, although Windows shoud defrag the RAM at runtime, at least to some degree)

As far as I know everything is fine, a least when the codec is ok.


fox95871(Posted 2009) [#5]
Great, thank you. I think my Systems Ram viewer thing is broken though. It looks like a heart monitor, right? I haven't seen it in ages. How do you get to it again?


Adam Novagen(Posted 2009) [#6]
Just hit Ctrl+Alt+Del, and click on the "performance" tab. The text box labeled "Physical Memory (K)" tells you how many KB of RAM are in use.


fox95871(Posted 2009) [#7]
Thanks.