Continuously running daemon process CFConstantStringRefs build up over time
Continuously running daemon process CFConstantStringRefs build up over time
- Subject: Continuously running daemon process CFConstantStringRefs build up over time
- From: Kevin Ross <email@hidden>
- Date: Thu, 30 Sep 2010 23:27:35 -0700
Greetings Cocoa Developers,
I have run into a snag while writing my background daemon and I was hoping that there might be some people on this list that could point me in the right direction or suggest a workaround. I am writing a background daemon to handle to field incoming software update requests for several client applications running in the wild. My implementation is working great, but I seem to have a slow buildup of CFConstantStringRefs that are being created by internal Foundation calls and CFSTR macros and are never released. This slowly builds up over time and there doesn't appear to be any way to release these strings.
I have run the daemon through the clang static analyzer and the Instruments leaks tool but none are reporting any leaks. I have even downloaded a fresh copy of valgrind from svn and it too is not finding anything. The instruments allocation monitor is reporting that there are CFConstantStringRefs that Foundation is allocating from internal methods and CFSTR macros that I am using in some functions. I'm happy to provide more details of the actual call-stacks and code if necessary.
Does anyone have any idea about what could be causing this or what I can do about it? While this isn't a big deal in the short term, I have seen it build up fairly quickly during stress testing. I have even tried setting hard and soft resource limits using the launchd plist by setting the MemoryLock and ResidentSetSize but these are not having the expected effect of limiting the memory buildup.
A work around I was contemplating was to have an idle timer that kills the app after a time if there are no active or incoming connections so it will then be restarted by launchd and reset the memory. This seems like a hack to get around the problem and I think I must be overlooking something.
Any help would be greatly appreciated as I've tried googling and re-reading the background daemon tech notes and have turned up nothing. Thank you for your help.
Sincerely,
Kevin Ross
_______________________________________________
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