• 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
NSTextView & Leaking Memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextView & Leaking Memory


  • Subject: NSTextView & Leaking Memory
  • From: Chris Ross <email@hidden>
  • Date: Sat, 2 Aug 2003 17:12:46 +0100

Hi,

I am completely stumped about this problem. I have a NSTextView
that I am updating by creating an NSMutableAttributedString and using
the [[textView textStorage] setAttributedString:] method.

The attributed string consists of a number of lines of text each
made up from a number of other AttributedStrings each with different
attributes. [on average 6 strings per line].

When the strings have been built and added to the NSTextView. The
display updates.

Now, when I do this a chunk of memory is allocated, when I do it
again (separated with [textView setString:@""]) more memory is allocated.
The strings never seem to get free'd even though everything sits in
a auto-release pool. 500 lines of the text tends to generate ~6000 objects.

Does anyone know of this problem ? is it me ? How can I force the
attributed strings to be free'd up when the display is cleared ?
This has been driving me up the wall as the program goes from about
5 megs memory usage [RPRVT] to 70 megs overnight.

Any help would be very much recieved,

Regards,

Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSTextView & Leaking Memory
      • From: publiclook <email@hidden>
  • Prev by Date: Re: custom NSTextField issue
  • Next by Date: fixing table in NSScrollView line scroll amount
  • Previous by thread: Re: NSImage -- getting raw bitmap data
  • Next by thread: Re: NSTextView & Leaking Memory
  • Index(es):
    • Date
    • Thread