Re: After Autoreleasing Still Getting Leaked
Re: After Autoreleasing Still Getting Leaked
- Subject: Re: After Autoreleasing Still Getting Leaked
- From: Bing Li <email@hidden>
- Date: Thu, 16 Jun 2011 03:50:36 +0800
Jens,
Thanks so much for your suggestions!
I wonder why it works fine according to Activity Monitor if such a huge leak
exists. The consumed memory in the Activity Monitor is stable and much
smaller unless some threads are created at a high concurrent moment. After
the threads are dead, the consumed memory becomes stable and small. I feel
weird for this.
Best,
Bing
On Thu, Jun 16, 2011 at 3:39 AM, Jens Alfke <email@hidden> wrote:
>
> On Jun 15, 2011, at 12:34 PM, Bing Li wrote:
>
> > Yes, TCP has the boundary issue. So I put a "\n" at the end of each XML.
> And there is no "\n" within any XML.
>
> That has nothing to do with the issue of UTF-8 sequences being split across
> reads.
>
> In UTF-8, non-ASCII characters are represented as multi-byte sequences
> (where each byte has the high bit set.) If the message is broken into
> packets such that one packet ends partway through such a sequence and the
> next packet begins with the rest of it, then neither packet’s contents will
> be parseable by itself as UTF-8 and the NSStrings you get will be nil. So
> you’ll lose data.
>
> > However, it should not be the reason to cause memory leaks, right?
>
> No, but it sounds like your code has bigger problems than memory leaks, so
> you probably shouldn’t worry about those yet. (And I believe we’ve already
> told you what you need to know about tracking down the leaks.)
>
> —Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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