• 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
Re: NSAutorelease and memory usage (multithreads)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSAutorelease and memory usage (multithreads)


  • Subject: Re: NSAutorelease and memory usage (multithreads)
  • From: "Hell's KItchen Hell's KItchen" <email@hidden>
  • Date: Wed, 23 May 2007 20:08:21 +0200

I'm sorry the method with "bad" NSScanner is here:
http://paste.lisp.org/display/41660

2007/5/23, Hell's KItchen Hell's KItchen <email@hidden>:
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


References: 
 >NSAutorelease and memory usage (multithreads) (From: "Hell's KItchen Hell's KItchen" <email@hidden>)

  • Prev by Date: NSAutorelease and memory usage (multithreads)
  • Next by Date: Re: drawing to an image and quickly copying it
  • Previous by thread: NSAutorelease and memory usage (multithreads)
  • Next by thread: Re: NSAutorelease and memory usage (multithreads)
  • Index(es):
    • Date
    • Thread