Movie playback causes memory accumulation

I’m creating an iPad puzzle game that involves playing a movie, presenting a puzzle, playing a second movie, second puzzle… and so on.

The problem is after the opening screen, the first movie loads and real memory (as seen in the activity monitor in Xcode’s Instruments) quickly goes from around 30MB up to around 120MB in the first few seconds. This crashes the app on a beta tester’s iPad 1. It only happens sometimes on our iPad 1 and never on our iPad2. The first puzzle is also around 130MB.

The following movies and puzzles show real mem around 20-30MB as expected. Any ideas why the first movie would accumulate so much memory?

Here the code to load the first movie
In scene 1: the code on the Play button that loads the movie 1 scene:

function  Activate() {
	if(PlayerPrefs.HasKey("GameComplete")) {
		if(PlayerPrefs.GetInt("GameComplete") == 1) {
			Application.LoadLevel("Game_Menu");
		} else {
			Application.LoadLevel("Game_Movie1");
		}
	} else {
		Application.LoadLevel("Game_Movie1");	
	}
}

And here’s the code for the scene that plays back the first movie and then loads the first level puzzle:

function Start() {
 	
   iPhoneUtils.PlayMovie("mov1.mov", Color.black, iPhoneMovieControlMode.Minimal);
 
 	if ( PlayerPrefs.GetInt("LevelPassed") < 1 )
	{
		PlayerPrefs.SetInt("LevelPassed", 1);
	}
	
	Application.LoadLevel("Game_Level1");
  
 }

I’ve tried putting in blank scenes in between the start screen, movie and puzzle. I’ve also tried a movie playback plugin in objective c. They all have the same problem.

Any idea why this will happen to only some movies and not others?

BTW, they’re all encoded as H.264, 1024x768 quicktime movies. But the same thing happens with other formats and sizes as well.

Thanks,
Charles

OK, issue resolved. It wasn’t the movie causing the memory accumulation. It’s the Application.LoadLevel(“Game_Level1”);
that starts loading as the movie is playing. And Game_Level1 is large.