Open stephanschulz opened 6 years ago
Can you try running the program just as an application outside of XCode? Ie., Just double click the compiled app and monitor memory usage using the activity monitor. It may be a new/unrelated bug, but when I was developing a HAP AVFoundation add-on I chased a suspected memory leak for weeks only to discover that it was actually a bug with Xcode and video - the memory leak only occured when executing the app from Xcode...
Same problem even without Xcode. Strange that loading a 340 MB video file with raw codec creates 80 MB memory increases.
I tried it also with OF 0.9.8 and on a different computer and see the same results. I guess since my video is very large I only notice it now and never before with much smaller files. But even smaller files (20MB) exhibit a slow memory build up.
In case someone wants to verify my findings. Here are my simple code and the video I'm testing with. https://www.dropbox.com/s/qj2fayxgs7m8dq7/videoPlayerExample.zip?dl=0
I can confirm the leak in Linux, ubuntu 16.04. Using the same example but switching between two different video Files. Memory usage continues to grow.
@arturoc @roymacdonald
I've built a custom video player that runs everyday, loading a new video each 10 seconds, and it freezes the computer after about 12 or 13 hours. Maybe it is related to this issue. I'll try to load a vector of videos to avoid calling load function a thousand times and see if it runs OK.
I'm just linking a forum post that seems to run on the same issues described here: https://forum.openframeworks.cc/t/memory-increases-at-each-rerun-how-to-free-it/37972/11
Hello @stephanschulz can you please try it again with the latest master? There are some recent changes in AVFoundationVideoPlayer which can help.
Using the video player example I am calling load every 10 seconds. Over time the memory builds up. I'm on macOS 10.12 with latest of_v0.10.0_osx_release.
Please look at screen shot to see file size, memory usage and load count.