• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Memory leak ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Memory leak ?


  • Subject: Memory leak ?
  • From: Jean Bovet <email@hidden>
  • Date: Mon, 28 Mar 2005 10:32:27 -0800

Hi all,

I currently have a memory leak problem in the following code:

- (void)parse
{
NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:[NSURL fileURLWithPath:@"/QuickTime_Tier1_proj.ad"]];
[parser setDelegate:self];
[parser parse];
[parser release];
}


- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI
qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
{
}


- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
}

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
{
}


- (IBAction)test:(id)sender
{
	int i;
	for(i=0; i<5; i++)
		[self parse];
}

When running the test method, the memory usage of the app grows up to 70Mb and stick then at 50MB (before running, the app was at 15 Mb). If I comment out all the delegate methods, the memory doesn't grows (it stays around 15Mb). Why is the memory not completely released ?

Thanks for any tips!

Jean

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Memory leak ?
      • From: Jean Bovet <email@hidden>
  • Prev by Date: Re: Need longer highlight w/ NSButton performClick:
  • Next by Date: Re: NSTableView and memory management problem.
  • Previous by thread: Re: Need longer highlight w/ NSButton performClick:
  • Next by thread: Re: Memory leak ?
  • Index(es):
    • Date
    • Thread