Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Headless Cocoa/Java app - autorelease



Perhaps you're being punished for using the Cocoa-Java bridge. Why not just write your NSImage stuff in pure Objective-C and run it as a separate process that the Java "front-end" communicates with?

-bob

On May 2, 2005, at 5:20 PM, String Larson wrote:

Thanks.

I had wrapped all my threads with pools (push/pop) just to try and see that was happening. I'm not getting the 'just leaking' messages any longer.
However, memory is not being released when the Java object containing NSImages is GC'd and/or the pool is released/popped.


I've been stripping things down - running a Java class w/o JBoss and as a single thread to eliminate variables. Still no luck.

Its behaving as if NSImage is leaking. It seems there is an OS thread (AppKit ?) that is alloc-ing NSViews and NSImageCacheViews w/ o a pool in place these don't seem to get collected when the NSImage is GC'd.

I'm going to put together a simple working example that can be posted here.
Any detailed info on AppKit/etc. would be helpful/welcome.


Thanks.


On May 2, 2005, at 3:57 PM, Shawn Erickson wrote:



On May 2, 2005, at 11:40 AM, String Larson wrote:


Do the sub-threads need AutoreleasePools as well ?

Any thread using aspects of the Cocoa framework (or related frameworks) runs under the assumption that the thread they are running in has a auto-release pool in place and more importantly one that is managed sensibly as needed (created/released as needed, saw per event processed, etc.)

So the answer is yes. The message is directly say that is in fact what is wrong.

I see no reason that you need to wrap the boot or main of JBoss with a auto-release pool because neither of those are likely using Cocoa directly and if they happen to be then the pool management you have isn't useful because the pool exists for the life of the JBosses main, in other words the pool would just accumulate objects to be released because the pool itself never gets deallocated.

Review...

<http://developer.apple.com/documentation/Cocoa/Conceptual/ MemoryMgmt/Concepts/AutoreleasePools.html>

-Shawn

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Headless Cocoa/Java app - autorelease (From: String Larson <email@hidden>)
 >Re: Headless Cocoa/Java app - autorelease (From: Shawn Erickson <email@hidden>)
 >Re: Headless Cocoa/Java app - autorelease (From: String Larson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.