NSAutorelease and memory usage (multithreads)
NSAutorelease and memory usage (multithreads)
- Subject: NSAutorelease and memory usage (multithreads)
- From: "Hell's KItchen Hell's KItchen" <email@hidden>
- Date: Wed, 23 May 2007 19:54:08 +0200
Hello, I've a NetSocket class, an async socket, that takes data, parse
it and save to disk. During save this method it's called 4 times for
each data packet (a message).
Unfotunatly I've two memory usage problems, according to OmniObject Meter:
The first is with NSConcreteData istance read from server, and the
second is with a method called when saving to disk - it uses lots of
NSScanner istances.
1) This is the method that read from server:
http://paste.lisp.org/display/41661
2) While this is the method that istances lots of NSScanner istances:
http://paste.lisp.org/display/41661
In order to solve (2) I've tried to add NSAutorelease at starts/end of
this method. It simply does not work and the program crashes with
badaccess.
I've also added an NSAutoreleasePool during data parsing from socket
(1) and this autorelease should be enough to solve both problems...
but not seems to be not so usefull because NSData I've read from
socket and NSScanner methods still in memory with or without the
autorelase.
Anyone can help me?
Thanks a lot.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden