Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: myapp + QTKit = growing memory usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: myapp + QTKit = growing memory usage



Are you disassociating the context before using the call again?

OSStatus stat = SetMovieVisualContext(yourMovie, NULL);


-- mikey

On 18 Oct, 2006, at 16:24, Mark McClain wrote:

I've been developing an app with QTKit. When I leave it running for sometime, I've noticed that the app slowly increases its memory usage. I ran both MallocDebug and leaks against the process to track down the problem. Both leaks and MallocDebug agree that leak occurs in gldGetString and it occurs everytime that SetMovieVisualContext is called. I was unsure wether the problem was in my app or in the way that I'm interacting with the framework, so I created a simple test app. To speed the test process up, I set the playback rate to 20, but the leak occurs when the rate is set to 1.0.

When I run the test app for 60 seconds, 18.2k is reported as a leak. After 2 minutes, MallocDebug reports 25.3k leaks. I ran the tests on a iMac Core Duo with Quicktime 7.1.3 installed. Am I missing something in my code or is there a deeper problem?

Thanks,

mark



#import "MyController.h"
#import <QTKit/QTkit.h>

@implementation MyController

- (void) awakeFromNib {
	use_a = YES;

	// catch movie ending
	[[NSNotificationCenter defaultCenter] addObserver: self
											 selector:@selector(nextMediaItem:)
												 name:@"QTMovieDidEndNotification"
											   object:nil];

}

- (void) applicationDidFinishLaunching:(NSNotification *)notification
{
	[self runNextItem];
}


- (void) runNextItem {
id movie;

if(use_a) {
movie = [QTMovie movieWithFile: @"/Users/mark/Desktop/spnmovies/ JRP.mov" error:nil];
} else {
movie = [QTMovie movieWithFile: @"/Users/mark/Desktop/spnmovies/ Rome.mov" error:nil];
}


	// movieView is an outlet to a QTMovieView defined in nib file.
	[movieView setMovie: movie];
	[movie setRate: 20.0];

	use_a = !use_a;
}


- (void) nextMediaItem:(NSNotification *) notification { [self runNextItem]; }

@end
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40bungie.org


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. QuickTime-API mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >myapp + QTKit = growing memory usage (From: Mark McClain <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.