On Oct 9, 2013, at 8:16 PM, Mauritz Jameson <mjames2...@gmail.com> wrote:

> The screen capture function is being called every 100ms approximately

Please tell me you’re not writing spyware… :-p

> and
> these frequent function calls seems to slow everything else down. After my
> program has run for a little while, the desktop and mouse pointer becomes
> very laggy/non-responsive. …

What you’re describing is exactly what happens when the OS starts thrashing due 
to too much memory being allocated. It sounds like your code has some serious 
memory leaks.

The easiest way to look at the memory usage of your app is with the Activity 
Monitor app. Or if you’re more comfortable in a shell, use top. The most 
significant statistic to look at is RPRVT.

I took a brief glance at your code, and it definitely looks like you’re not 
cleaning up everything you need to. I’m not very familiar with the CoreGraphics 
API, but you call CGWindowListCreateImage and then never seem to 
dispose/release/free that image. Considering that the image ref must be holding 
onto a giant pixmap the size of the screen, that’s probably the source of your 
problem.

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to