Web Kit creating hundreds of Java threads
Web Kit creating hundreds of Java threads
- Subject: Web Kit creating hundreds of Java threads
- From: Matt Gough <email@hidden>
- Date: Wed, 25 Jun 2003 15:36:12 +0100
I am experimenting with Web Kit in my Carbon application to try and get it
to generate previews of web sites in a GWorld. These GWorlds are then drawn
in a variety of places. My app doesn't do any browsing as such and the user
does not interact with Web Kit. To put it simply, I am trying to use Web Kit
to display URLs in the same way you would use QT Graphics Importers to
display image files.
This works surprisingly well, except for web pages that need to do some java
stuff (E.g
http://news.bbc.co.uk).
After getting Web Kit to draw such a page, my application starts getting
Java threads being spawned continuously. This even happens long after the
drawn WebView has been released.
Some such threads (as seen by Sampler) are listed at the end of this email
in case anyone can make any sense out of them.
I am guessing that whatever java stuff is being created by Web Kit is not
running in an environment that it is able to cope with.
Here is brief overview of what my app does (its carbon remember so I call
into Web Kit via a Cocoa bundle). I have interspersed the Carbon and Cocoa
portions here. I didn't want to bore you with all the details of my bundle
loading and parameter passing between the two:
w = CreateNewWindow;
WebInitForCarbon();
HIWebViewCreate(hiView);
HIViewAddSubview(::HIViewGetRoot(w), hiView);
SetControlBounds(hiView, BoundsOfWindow(w));
HIViewSetVisible (hiView, true);
WebView* wv = HIWebViewGetWebView(hiView);
if (wv)
{
WebFrame* wf = [wv mainFrame];
[wv setMaintainsBackForwardList:NO];
[wf loadRequest:[NSURLRequest requestWithURL:url]];
/*
Run the current event loop for a couple of seconds to allow
Web Kit to do its stuff. I don't care if it hasn't finished by then
*/
RunCurrentEventLoop(2.0);
[wf stopLoading];
[wv display];
}
CopyBits(w, gworld);
DisposeControl(hiView);
DisposeWindow(w)
Is there anyway of getting Web Kit to avoid Java entirly?
Is there any way of just getting Web Kit to be used in a one-shot way (i.e
not for browsing, just for synchronous rendering.)
Please note that this is the first time I have dabbled with anything Cocoa
related so I may have missed something important.
Any suggestions of things to try would be much appreciated.
Matt Gough
***** Some of the several hundred runaway Java threads
1 0xffffffc5
1 eh_rest_world_r10
1 _pthread_body
1 JVM_GetClassMethodsCount
1 JVM_FindClassFromClass
1 JVM_GetMethodIxExceptionTableEntry
1 JVM_IsSameClassPackage
1 JVM_FindClassFromClass
1 JVM_CurrentTimeMillis
1 typeinfo name for std::bad_exception
1 0x3ce686c
1 0x3e25d4c
1 0x3e0b1d8
1 _mh_dylib_header
1 0x0
1 swtch_pri
1 swtch_pri [STACK TOP]
1 0xffffffe1
1 mach_msg
1 _pthread_body
1 JVM_GetClassMethodsCount
1 JVM_FindClassFromClass
1 JVM_GetMethodIxExceptionTableEntry
1 JVM_IsSameClassPackage
1 JVM_FindClassFromClass
1 JVM_CurrentTimeMillis
1 typeinfo name for std::bad_exception
1 0x3ce686c
1 0x3ce65cc
1 0x3ce668c
1 0x3e0b640
1 0x3e0b43c
1 JVM_MonitorWait
1 JVM_MonitorNotify
1 JVM_ArrayCopy
1 JVM_NewInstance
1 0x2e73746d
1 mach_msg_trap
1 mach_msg_trap [STACK TOP]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.