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

Re: HTML Editor


  • Subject: Re: HTML Editor
  • From: Creed Erickson <email@hidden>
  • Date: Fri, 6 Jun 2003 10:56:09 -0700

You are creating NSDate objects at an incredible rate. Each time you ask the thread to sleep, you leak another NSDate.

Try:

myDate = [NSDate dateWithTimeIntervalSinceNow:0.001];
[NSThread sleepUntilDate: myDate ]
release myDate;

where myDate is declared somewhere as "myDate *NSDate"


This should stop the leaking, but there certainly would seem to be better, more efficient ways of doing pausing a thread for a bit. Have you considered just using usleep? (See man 1 usleep.)

On Friday, June 6, 2003, at 09:42 AM, Chuck Rice wrote:

I have a thread defined that runs async to the rest or my program to keep a USB attached LDC display updated with current status information. Works great, except for this huge memory leak! :( The memory leak goes away if I comment out this line in the code:

[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.001]];

With this line active I get a 10 to 20 Meg memory leak every minute. I am still an obj-C newbie, so forgive me if it is obvious. -Chuck-


--
Fight Spam! Join CAUCE! == http://www.cauce.org/
_______________________________________________
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.


---
Creed Erickson <email@hidden>
"The early bird gets the worm, but the second mouse gets the cheese." -- unknown
_______________________________________________
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.
References: 
 >Re: HTML Editor (From: Chuck Rice <email@hidden>)

  • Prev by Date: Re: TextView problem
  • Next by Date: Re: Adding a folder to a built application
  • Previous by thread: Re: HTML Editor
  • Next by thread: Re: HTML Editor
  • Index(es):
    • Date
    • Thread