jit.movie memory usage
Hello,
after having looked through the forum for a while now to find something and even though there is a lot of talk about it, I haven’t found a solution to my problem yet.
I am building a standalone video player system that deals with different banks of videos which are triggered on time and go into one jit.movie. I am running avf as a codec and my files are 1280x720 h264 mp4s to keep the file size down. And we have 4 banks of around 30 movies at max. 3mb each.
While running, I get a constant ~45 fps out of it so performance wise I am totally happy with it.
The real problem is that every time I am reading a new file into the jit.movie my memory usage shoots up. Seeing that this standalone needs to run for a day at a time I can’t afford the system to run out of memory after a few hours. This is happening on a brand new 13" MacBook Pro with 8gb of RAM (specs here: http://www.apple.com/uk/macbook-pro/specs-retina/).
My next step is to convert to uyvy colour mode and motion jpg a to see what I can get out of it. I was looking into Loadram but it seems that it is impossible with avf.
Example patch is attached, you will see what I mean when you look at your Activity Monitor.
I would be very very grateful for any help, this is becoming a real problem.
hi michael.
thanks for putting this report together. i do notice a memory usage increase when reading in files using jit.movie.
few things: first, you should enable texture output on your jit.movie, since you are going straight to a gl context (@output_texture 1). this will greatly increase your FPS performance. you could also set the @colormode to uyvy if you aren't using any files with an alpha channel. the texture will still output in rgba mode, but it will be transferred to the GPU using uyvy colormode, which is slightly faster.
also, use "asyncread" instead of "read". this will get rid of the memory leak, and you won't have to change anything about your patch other than that message.
lastly, you can get rid of the "r draw" in your patch, as the jit.world will automatically tell jit.movie objects to output when jit.movie @automatic is set to 1 (this is a new feature of max 7).
hope this helps, and i will investigate the memory leak with the read message.
Hi Rob,
thank you very much for the detailed answer, I will take a look at this shortly and report back. It is good to get more information to the new Max7 objects for future projects!
What I discovered in the meantime seems to have helped quite a lot —sending a clear message to jit.movie on loopnotify and delaying the next read by 200ms might lead to a slight break between the footage but the memory usage stays stabile. It has been constantly running now for the last four hours and is doing ok.
Thanks, Rob. I have a similar situation and this information was very helpful.
Rob — is there any update to this advice given the recent fixes to the jit.movie object in 7.1? My video installation patch seems to degrade over time after updating to 7.1. (Perhaps I shouldn't have updated, but the "relaunchmax" message was a very useful addition) There does not seem to be any evidence of a memory leak. Framerates begin to dip after a while, then slowly drop while still exhibiting dips. I am preparing test patches now.
Thanks
hi slo, if you can send a patch, system specs, and some steps to reproduce i can investigate the degradation in performance.
the jit.movie memory leak should be fixed in 7.1
Hi Rob,
Yes, I did submit a report to support. Unfortunately I can only access the installation computer remotely and it is "performing" at the moment, so I have had troubles isolating the problem. I can't run the full patch on my own laptop and haven't been able to test well. Is it possible to get my hands on a copy of 7.0.6? I would like to roll back until I can sort through this problem better.
Thanks for the response
Simon
Thanks Rob. I will let you know what I learn from comparing the versions and from efforts isloating the problem.
Simon
Rob,
BTW whatever the problem may be, I don't think it is a memory leak. Not only am I using "asyncread" but Max does not show increased memory consumption over time or whenthe performance starts to drop.
Simon