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: mysterious Java application crash




On Apr 10, 2007, at 2:27 AM, Florian Bruckner (3Kraft) wrote:

Dear Greg,

having again read through the documents you mentioned I am where I was before. The application is plain Swing, there is only a single snippet of code that is using Cocoa API, and that does like the links recommend - keep the list in an NSArray and the iterate over it (Note that this codesnippet works with introspection to allow compilation on Non-MacOS X machines as well):

Did verbose gc tell you where or with what object you were having the problem? I think I saw some message(s) that appeared to indicate it was on.


Have you tried System.out.println's in overriding finalize methods to narrow it down?

You might try it synchronized and/or on the main AppKit thread. ObjC is more officially recommended for this sort of thing these days as the Googled link indicated. I do have a small Cocoa jnilib that allows callbacks to Cocoa Java on the main thread.
http://users.spacestar.net/mikehall/javasrc.html#onmain
If you do want to see if that makes a difference.


Is there any way to accomplish this with CocoaComponent? A little more officially supported.

Have you reviewed TN2147? It's JNI but there might be something that applies.

Besides NSArray have you tried to figure out an alternative way to 'retain'' things on the Cocoa side?

There was a recent list thread
JNI/Cocoa Memory leak
that touched on some of this as well and ended up as I remember it with a bug involved. What problems it was causing the application were a little less obvious to me.



Mike Hall mikehall at spacestar dot net http://www.spacestar.net/users/mikehall http://sourceforge.net/projects/macnative



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

This email sent to email@hidden
References: 
 >Re: mysterious Java application crash (From: Greg Guerin <email@hidden>)
 >Re: mysterious Java application crash (From: "Florian Bruckner (3Kraft)" <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.