[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ONTCPSocket
- Subject: ONTCPSocket
- From: richard at brainstorm.co.uk (Richard Frith-Macdonald)
- Date: Sun Mar 3 08:32:00 2002
- In-reply-to: <B8A7AAB1.2FEF%btr5290@rit.edu>
On Sunday, March 3, 2002, at 03:25 PM, Brandon Regard wrote:
> Hi,
>
> I'm using readData on a ONTCPSocket to get some NSData, then I write the
> data to a file. This is done chunk by chunk in a while loop. After I
> have
> written the data to file, I don't need the NSData that readData got me.
> The
> problem is when I am retrieving a large file and I wait for autorelease
> when
> the the file is done and the loop has exited, readData eats up a huge
> amount
> of memory. But, if I release the data manually on each iteration, when
> I get
> to autorelease (or the end of my thread) my program sigs because it
> can't
> autorelease something that?s allready released. Any ideas....
Create and destroy autorelease pools each time round the loop. Unless
the data
is being read in another thread, that should solve the problem.