How to ease the burden on the Garbage Collector?

2009-10-08 Thread Gabriel Zachmann
I'm writing a simple screensaver that is basically kind of a slide show screensaver. (So it loads many images over time, but needs to keep only 2-3 in memory at any given time.) I am using Core Animation for some animations on the images. I've just profiled the screensaver under 10.6 using S

Re: How to ease the burden on the Garbage Collector?

2009-10-08 Thread Bill Bumgarner
On Oct 8, 2009, at 7:29 AM, Gabriel Zachmann wrote: It seems that about 20% of the time is spent in the Garbage Collector thread! Which is a bit surprising to me, since I don't allocate a large number of objects (I think) -- just a small number of large objects (the images). The collec

Re: How to ease the burden on the Garbage Collector?

2009-10-08 Thread Shawn Erickson
On Thu, Oct 8, 2009 at 7:29 AM, Gabriel Zachmann wrote: > I'm writing a simple screensaver that is basically kind of a slide show > screensaver. > (So it loads many images over time, but needs to keep only 2-3 in memory at > any given time.) > > I am using Core Animation for some animations on the

Re: How to ease the burden on the Garbage Collector?

2009-10-09 Thread Gabriel Zachmann
It seems that about 20% of the time is spent in the Garbage Collector thread! Which is a bit surprising to me, since I don't allocate a large number of objects (I think) -- just a small number of large objects (the images). The collector only chews CPU when there are lots of allocation

Re: How to ease the burden on the Garbage Collector?

2009-10-09 Thread Jens Alfke
On Oct 9, 2009, at 7:23 AM, Gabriel Zachmann wrote: http://zach.in.tu-clausthal.de/tmp/malloc1.png http://zach.in.tu-clausthal.de/tmp/malloc2.png http://zach.in.tu-clausthal.de/tmp/malloc3.png Those are showing all malloc operations. Most of those are not garbage- collected, so they don't af

Re: How to ease the burden on the Garbage Collector?

2009-10-10 Thread Gabriel Zachmann
Thanks for the response. So, is 20% CPU time for the GC thread normal? Yup, that shows about 20% (of a core) being spent in GC. Best regards, Gabriel. smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@

Re: How to ease the burden on the Garbage Collector?

2009-10-10 Thread Jens Alfke
On Oct 10, 2009, at 1:14 AM, Gabriel Zachmann wrote: So, is 20% CPU time for the GC thread normal? That's a lot more than I'd expect based on what you're doing. Either you've got code you haven't shown us that's allocating a ton of objects during the animation, or some system framework (C