• 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: appendBytes memcpy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: appendBytes memcpy


  • Subject: Re: appendBytes memcpy
  • From: Chris Suter <email@hidden>
  • Date: Thu, 2 Aug 2007 16:16:30 +1000


On 02/08/2007, at 3:58 PM, roger casaliƱas wrote:

largest single allocation? when you say single, do you mean one
NSMutableData object?

I put a debug tracker on the length of the NSMutableData object and the
largest value it got to before crashing is 745316412. Is that +-745MB?


Is there a way to remove used bytes from the earlier part of the buffer (the
bytes that were appended earlier)? It's not possible for me to release the
buffer since another thread is reading off of the buffer in a slow pace. I
was wondering if the reader can take off the bytes it has read (so the
buffer wont reach near a GB that fast)?


Additional info on the problem: it _ALSO_ happens on PPC. sorry, tester's
bad. hihi.


Thanks,

Roger

Hi Roger,

Even if you removed data from the beginning, unless you can make guarantees as to how fast the reader will operate (relative to the writer) and how long it will run for in the case that the reader is slower than the writer, eventually you'll run out of memory again.

If you can block the writer thread you could use a ring buffer (for example).

If you could tell us what problem you are trying to solve we might be able to better help you.

Kind regards,

Chris

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >Re: appendBytes memcpy (From: Shawn Erickson <email@hidden>)
 >Re: appendBytes memcpy (From: "roger casaliƱas" <email@hidden>)

  • Prev by Date: Re: appendBytes memcpy
  • Next by Date: Re: appendBytes memcpy
  • Previous by thread: Re: appendBytes memcpy
  • Next by thread: Re: appendBytes memcpy
  • Index(es):
    • Date
    • Thread