yarglaaaafr
YaBB Newbies
Offline
Posts: 1
Re: Movie - Memory being eaten up constantly
Reply #14 - Nov 20th , 2008, 3:54pm
Hey, I think I'm experiencing the same problem in my program. In order to make sure Movie playback causes the problem, I started modifying "Loop" bundled example: I just changed the way playback loops, by using play() instead of loop(), and by checking for the end of the movie, then I stop(), re-create and play() again. The result seems exactly the same as the original example, except it uses more and more memory, and never releases it. The result is an "out of memory error" after quitting. Here's my -hacked- Loop example: /** * Loop. * * Move the cursor across the screen to draw. * Shows how to load and play a QuickTime movie file. */ import processing.video.*; Movie myMovie; void setup() { size(640, 480, P3D); background(0); // Load and play the video in a loop initMovie(); } void initMovie () { myMovie = new Movie(this, "station.mov"); myMovie.play(); } void movieEvent(Movie myMovie) { if (myMovie.duration() != myMovie.time()) { myMovie.read(); } else { myMovie.stop(); myMovie = null; // useful? initMovie(); } } void draw() { tint(255, 20); image(myMovie, mouseX-myMovie.width/2, mouseY-myMovie.height/2); } remarks: # I'm using Processing 0157, on Windows XP SP3 and MacOS 10.5.5 # about myMovie = null; I'm a C++ programmer, so I don't know much about "memory management" in Processing/Java; because it's a garbage-collected langage, I suppose it's useless, but not critical.