JNI native threads causing JRE to fail to shut down?

Hello,
I am using JNI to communicate with a COM object. I am reasonably certain at this point that my JNI code is handling this properly and the third party COM library is releasing the object in question. We allocate and release hundreds of these objects and we aren't observing any memory leaks. Likewise in our handling of events we receive from the COM object. We attach the thread to Java, deliver the event, and then detach the thread from Java, with very careful error handling around the event delivery to ensure that whatever else happens the detach gets called. This code is very robust and stable in operation and has been working at load in the field for over a year now without any customer problems in the JNI area.
However, since day one, when I go to shut down the application, the JNI isn't winding down properly. As it happens, since the JRE is running a Tomcat, driven by a wrapper service, the wrapper eventually gives up waiting and shoots the JRE in the head, but the user experience of stopping the wrapper service is ugly and we'd like to clean that up. The JNI code, of course, runs as shared code in the Tomcat.
It is possible that the third-party library, which does network communications, is keeping a thread pool for use with any of the COM objects even after all COM objects are released. This would be experienced as a one-time hit when the first object is allocated and not as a continual leak, so we'd be unlikely to notice it otherwise.
Will native non-Java threads running in the JRE but not allocated by the JRE itself cause the JRE to hang on until they've spontaneously decided to clean themselves up? Threads that have never been attached to the JVM? How about threads that were briefly attached to the JVM but then detached? Any worse?
Ralph

Hi Ralph,
I will need some more information regarding this issue.
1. What platform are you on?
2. Which JRockit version are you running?
3. If you remove the wrapper service, does JRockit freeze without exiting properly?
As a general recommendation I would try to upgrade to the latest JRockit version. It can be downloaded from the OTN http://www.oracle.com/technology/software/products/jrockit/index.html
You may also try some verbose printouts to debug the issue a little further. Try
-Xverbose:thread=debug,jni=debug
This might give us some more insight in what is going on.
Also when JRockit freezes you can output a Java stack trace using our 'jrcmd' tool which you can find in the same folder as the java executable. Run this tool without any parameters and it will output identifiers (numbers) for every running JRockit instance on your machine. Run the same tool again, this time append the identifier you believe is the one running the Tomcat and add the command 'print_threads', ie
jrcmd <some_id_here> print_threads
This may show what JRockit is waiting for.
Cheers,
/Henrik

Similar Messages

  • Each time that I go into edit with Photoshop Elements 8 it causes a physical dump and shuts down

    Each time that I go into my Photoshop Elements 8 it causes a physical dump and shuts down.  I have only used this program a few times although I have had it a few years.  The first couple of times it worked fine; but now, it shuts me down each time.  I have already tried unistall and reinstall.  Help!

    Well, can you try opening just the Photoshop Elements 8 (from the Start menu) and see if it opens Editor from Welcome Screen or not?
    It it still crashes, please try couple of probable solutions as mentioned below:
    Solution 1:
    Close Elements.
    Launch the Photoshop Elements Welcome Screen and hold down ctrl + alt + shift as you click Editor.
    Continue to hold the keys until you see a message box asking if you want to delete Photoshop Elements settings file; click Yes. Elements will open with default preferences.
    Solution 2: In case any network printer is attached try to launch without network or printer uninstall or make different printer as default.
    Solution 3: Try launching with anti-virus off or removing PSE from conflicting list.
    Solution 4:
    On the drive on which you have installed PSE,on my machine it is on C:
    Go  to C:\Program Files\Adobe\Photoshop Elements 10\Locales\<locale>\Plug-Ins\Import-Exportand you will find twain  plug-in. Remove that plug-in from that location and copy it somewhere else.
    Now launch PSE and check if it works.

  • HT201401 What causes the iPhone 4S to shut down to a black screen when it has full power?

    What causes the iPhone 4S to shut down to a black screen when it has full power? I have cleared the open icons and it works for one day then shuts down again.

    Software hiccup, glitch or maybe faulty battery. Restore iPhone with iTunes on computer. See if this helps. If still problem that you think is serious enough to fix, all iPhone 4S have full Warranty. Make Genius Reservation and take iPhone to Apple for resolution.

  • Why Does Mac Book Pro fail to shut down?

    I hope I am placing this in the correct place, as I have had enough difficulty finding where to "Post a Topic" Bought a new MacBook Pro with Leopard on 1/4/08. It fails to shut down, all I get is the spinning wheel (for want of a better word) until I am forced to press the shut off button. To date, In-store tech support has archived and re-installed, re-set the PRAM, and I don't know what's left! It seems that every time I do "something" i.e., backup, download photos, etc., even when I carefully close out the applications, and wait, the machine fails to shut down.
    Does anyone out there have a solution to this problem? Is Apple working on this or are they taking the "it's you" attitude? Please advise and many thanks.
    Maxsgirl
    Levittown, NY

    The "Genius Bar" at the Apple Store turned off the "Sync" to the iDisk. This has seemed to resolve the issue, however, MacBook Pro is not problem-free. Let me know if we "share" any other issues. Recently attempted to use Adobe Photoelements, by the way, after being told it was compatible with Leopard, IT IS NOT. So now I am going to try Aperture. Just thought I'd throw that in as "one of the other" issues! Thanks for responding to me!
    Fibrogirl

  • MBP fails to shut down

    Lately my MBP fails to shut down. I quit all apps and then click shut down, the dock and menu bar go away just leaving the apple desktop and the mouse (turns to the beach ball after a while). Last week I wiped my computer and started from scratch hoping it would fix the problem but it didn't. I have repaired permissions and reset the PRAM and have taken out the battery and held the power button for five seconds to reset something else (i forget what it is called). I am thinking this has something to do with time machine and my time capsule. Sometimes time machine will attempt to backup, but will sit at preparing for hours without ever mounting the image. I try to stop it but it wont stop and at that point I can't shut down. Isn't time machine supposed to stop when I shut down? Even if i force quit the backupdb process in activity monitor, my computer will not shut down. So as far as I can tell, time machine is doing something to prevent shutdown or something is but it is really getting annoying. Any help is appreciated.

    Check your console log using the Console application and look around about your shut down time. Look for information about a process that did not shut down. Usually shutdown problems occur because an application you are using does not completely shut down or stops responding.
    Does the computer shut down normally if you don't run any applications? Have you tried creating a new user account, then logging into that account instead of your normal account? Does the computer now shut down normally? Have you tried booting into safe mode to see if the computer will shut down normally?

  • JNI native thread priority

    Hi,
    I have some JNI code that spawns a win32 thread using CreateThread and then sets it priority using SetThreadPriority.
    If i set priority higher than ABOVE_NORMAL ( i would prefer time critical), it seems the JVM crashes on exit.
    I've commented everything out in the thread method itself except to let it do a while(true){Sleep(1);}.
    If i remove the SetThreadPriority or set it to ABOVE_NORMAL or less the JVM doesnt crash when the java code calls System.exit but otherwise it does.
    Any ideas concerning this?

    Hmm..
    I was using System.runFinalizersOnExit(true), when i removed that from the java side the problem disappeared. I dont really need to make that call anyway, but i dont like when errors disappears and i dont understand why, so i would like to know how that call in conjunction with a high priority native thread can cause a jvm crash?

  • JVM dies when JNI native code causes a SIGABRT from assertions

    Hi,
    I am wondering whether there is a way to prevent the JVM from dying when the JNI native code hits an assertion.
    #include "NativeTest.h"
    #include <assert.h>
    JNIEXPORT jstring JNICALL Java_NativeTest_sayHello (JNIEnv *env, jobject thisobject, jstring js)
    assert(0);
    return js;
    Calling this code from Java through JNI causes a SIGABRT when assert(0) is hit. This causes the java program to terminate. Is there a way for the JVM to recover from the SIGABRT from the native code?

    929919 wrote:
    I am wondering whether there is a way to prevent the JVM from dying when the JNI native code hits an assertion.There is no way to prevent the VM from exiting if native code does anything that causes an exit.
    An assertion is only one way that can happen.
    So to prevent the VM from exiting - don't run native code. The safe way to execute OS native library is to do the following.
    1. Wrap the library in an executable.
    2. Create a communications API for the executable.
    3. Manage the executable via Java Runtime.exec/ProcessBuilder.
    4. Talk to the executable using the communications API from 2 in the java code.
    The above is safe because if the library exits it exits the executable, not the VM.

  • Corrupt media causing dropped frames? FCP shuts down without warning.

    Hello,
    I have a project that was working fine, then one day we started getting numerous dropped frame warnings during playback on the timeline (specifically during sequences that have multiclips); then two days later, playback causes the entire project to freeze and FCP shuts down.
    We are on 17" MacBook Pro, 2.4 GHz Intel Core 2 Duo, 2GB 667
    Mac OS X 10.4.9
    External drive: Western Digital 1 TB, My Book Pro Edition, FW 800, 7200rmp, 650GB used
    FCP 5.1.4, DV-NTSC project, source media captured from DVCam
    I have tried all the normal adjustments for dropped frames issues including boosting the ram allocated to FCP, closing additional sequences and applications, hard drive is formatted OS X Extended, etc. Multiclip squences have only 2 video/audio streams at a time, so I can't imagine that its bottle necking here.
    One thing to note is that the second external drive, which has duplicates of all the same media and copy of the most recent project is working fine. The only difference is that the problem drive also has media that was ripped from DVDs using Mac The Ripper, and then compressed using MPeg Streamclip into .dv (then changed to .mov before importing into FCP). We are using the DVD material as scratch until we can obtain the original footage as we get closer to going online. We are in the process of obtaining permissions from directors/distributors/studios, but this obviously takes time.
    DVD material is totaling close to 55GB. Also, even though the clips are .mov, we are still getting a red bar and having to render the media. Audio is at 48hz so no problem there. Not sure why it still requires us to render.
    Is it possible that the project is somehow corrupt? Is all the rendered material too taxing for FCP? Am I handling this extra footage inefficiently?
    I have spent hours on this forum looking for the answer, but haven't come across a solution yet. Thank you for your help.

    I'm not sure I understand. You have duplicate media on another drive? You're having problems playing back the media from one drive but NOT the other? Sounds like your drive might be failing. Try running Diskwarrior (to repair any possible directory structure problems) and techtoolpro (to see if there's any physical problem).
    I have had problems with multiple firewire drives from different manufacturers connected at the same time. Try disconnecting everything BUT the problem drive.
    You shouldn't need to do any rendering if the clip settings exactly match the sequence settings. Try this: select one clip, control click and choose make multiclip sequence. Is there a red bar in the sequence? If not, your clip settings to not match your sequence settings in the problem sequence.
    Good luck

  • Leopard Failing to shut down

    Intermittently, I have been getting this message when I try to shut down my Core2Duo Macbook running Leopard 10.5.1: "Logout has timed out because the application 'X' failed to quit. Try again, quit 'X' and choose Log Out from the Apple menu," where "X" is a random program (although most of the time it is Preview). The problem is is that "X" application is not open or is running when I look at the Console. When I open application "X," quit the application, then try to Shut Down, I get the same message but with a different application. These applications are not running when I look at the Activity Monitor. I haven't found what the cause is and it doesn't occur every time. I have noticed that it will do it when I've had a problem waking up my Macbook from sleep mode (it will give me a black screen after logging-in but will awake from sleep if I close my Macbook and try again).
    My event log shows the following:
    12/24/07 9:34:15 AM com.apple.dyld[820] updatedyld_sharedcache: warning can't use root /Applications/Safari.app/Contents/MacOS/Safari: can't open file, errno=2
    12/24/07 9:34:15 AM com.apple.dyld[820] updatedyld_sharedcache: warning can't use root /Applications/Mail.app/Contents/MacOS/Mail: can't open file, errno=2
    12/24/07 9:34:15 AM com.apple.dyld[820] updatedyld_sharedcache: warning can't use root /Applications/iChat.app/Contents/MacOS/iChat: can't open file, errno=2
    12/24/07 9:34:19 AM loginwindow[39] ERROR | WSActivateApp | SetFrontProcess({0, 352342}) returned error -600. Unable to activate process.
    12/24/07 9:34:24 AM com.apple.launchd[1] (com.apple.dyld) Throttling respawn: Will start in 51 seconds
    12/24/07 9:35:02 AM loginwindow[39] ERROR | WSActivateApp | SetFrontProcess({0, 352342}) returned error -600. Unable to activate process.
    12/24/07 9:35:09 AM bootpd[171] can't open /etc/bootptab
    12/24/07 9:35:09 AM bootpd[171] server name Macbook.local
    12/24/07 9:35:09 AM bootpd[171] interface en0: ip 192.168.2.1 mask 255.255.255.0
    12/24/07 9:35:09 AM bootpd[171] interface fw0: ip 192.168.3.1 mask 255.255.255.0
    12/24/07 9:35:09 AM bootpd[171] interface en1: ip 192.168.0.104 mask 255.255.255.0
    12/24/07 9:35:09 AM bootpd[171] interface en2: ip 192.168.4.1 mask 255.255.255.0
    12/24/07 9:35:09 AM bootpd[171] interface en2: ip 169.254.9.247 mask 255.255.0.0
    12/24/07 9:35:09 AM bootpd[171] interface en3: ip 10.211.55.2 mask 255.255.255.0
    12/24/07 9:35:09 AM bootpd[171] dhcp: re-reading lease list
    12/24/07 9:35:15 AM com.apple.dyld[823] updatedyld_sharedcache: warning can't use root /Applications/Safari.app/Contents/MacOS/Safari: can't open file, errno=2
    12/24/07 9:35:15 AM com.apple.dyld[823] updatedyld_sharedcache: warning can't use root /Applications/Mail.app/Contents/MacOS/Mail: can't open file, errno=2
    12/24/07 9:35:15 AM com.apple.dyld[823] updatedyld_sharedcache: warning can't use root /Applications/iChat.app/Contents/MacOS/iChat: can't open file, errno=2
    12/24/07 9:35:15 AM com.apple.launchd[1] (com.apple.dyld) Throttling respawn: Will start in 60 seconds
    12/24/07 9:36:04 AM natd[789] failed to write packet back (No route to host)
    12/24/07 9:36:16 AM com.apple.dyld[824] updatedyld_sharedcache: warning can't use root /Applications/Safari.app/Contents/MacOS/Safari: can't open file, errno=2
    12/24/07 9:36:16 AM com.apple.dyld[824] updatedyld_sharedcache: warning can't use root /Applications/Mail.app/Contents/MacOS/Mail: can't open file, errno=2
    12/24/07 9:36:16 AM com.apple.dyld[824] updatedyld_sharedcache: warning can't use root /Applications/iChat.app/Contents/MacOS/iChat: can't open file, errno=2
    Anyone else with this problem or know why it is doing this?
    Message was edited by: pup975

    It is likely that you are experiencing some conflicts.
    The main conflicts are cache, permissions, fonts and login items.
    If you did an upgrade of Leopard over Tiger you could have all 3.
    The log seems to point to some cache problems.
    So let's start with user cache.
    In Finder click on Go>Home>Library and pull the Caches folder to the Trash.
    Then click on the hard drive icon in the sidebar and double click on this Library and remove Caches here too.
    Click on the apple>System Preferences>Accounts and unlock the lock.
    Click on login items and remove all items from the window.
    Then Go>Utilities>Disk Utility and select your hard drive volume then Verify Disk.
    If the disk passes then Repair Disk Permissions.
    Once any repairs are done, quit Disk Utility.
    Click on Go>Applications>Font Book.
    In Font Book choose All Fonts in the 1st column, then click into the second column.
    Check for a black dot to the right of any of the fonts in the list in the second column.
    If there are any dots the click on Edit>Select All.
    Next Edit>Resolve Duplicates.
    Next File>Validate Fonts.
    Put a check mark in the box to the left of all fonts that shows problems and click on Remove Checked.
    Next boot to the Leopard install disk >Utilities>Reset Password.
    Click on your hard drive volume>home directory user name>Reset permissions and ACL's at the bottom.
    Then restart your computer.
    This will rebuild some Cache files so it will be slow on this startup.

  • Printing duplex with HP Officejet Pro 8600 causes windows 7 OS to shut down/restart

    Why when printing duplex with my HP Officejet Pro 8600 printer it causes windows 7( 64-bit) to shut down/restart. Windows message is "Windows has recovered from an unexpected shutdown.  I've ran HP Hardward Diag. Utility and Print and Scan Doctor which indicated everything is working properly with the printer.  Ocassionaly I can print duplex without windows shutting down and restarting, but most of the time it creates issue with Windows causing it to stop and restart.  Single sided printing seems to be fine.  I've already oncehad windows to "Startup Repair" in which ccase I selected restore to a previous working point.  Everything worked for awhile then a duplex printing session starting causing windows to shut down again.   THanks for your assistance.

    Yes, the updated USB 3.0 driver corrects the issue and should be installed.  
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • IE causes some PC's to shut down browser when visiting my sites

    When some people using PC's visit my sites using IE, they get a message syaing that there is an error and that IE has to shut down. Sometimes they can view certain pages then others result in a browser crash. Though there are some people that can view the pages fine in IE. Does anyone know what might be triggering the shutdown? Are there any realistic solutions other than asking everyone to switch to MAC?

    You probably won't convince people to switch to Mac, just because they couldn't view iWeb sites. But you probably have better luck to convince people to switch their browsers. See this thread:
    http://discussions.apple.com/thread.jspa?messageID=2240455

  • Help! Mid files cause "out of memory" session shut down.

    When I export .mid files from Reason 7 and import them into Logic Pro 9, it give me the error message "out of memory" and shuts down the session. Help!!

    I tried a number of values that were multiples of 1024 (2048, etc).
    The only thing that worked seemed to be changing the number and rebooting the server machine.
    Not sure what caused the initial problem though.  Saw very wierd activity in the FMS console.  Had a few hundred users connected, as I typically do for one of my events, and the chat application was repeatedly unloaded from FMS.  When it was reloaded the FMS console would show crazy large numbers in the "Clients" column - numbers like 3954.  Then it would drop to like 340.  Then shoot up again to wildly large numbers.
    Is that the result of a memory problem?

  • MacPro Fails to shut down

    After I upgrade my 2009 MacBook Pro to Lion, I has problems shutting down.  It locks up and fails to shutdown.

    By chance any applications open  when shut-down is clicked.
    Some times some open applications prevent computer from shutting down.
    It happened to me couple of years ago.

  • Fails to shut-down

    when computer is put to sleep it starts up agan, when shut down it restarts.

    joanlyons wrote:
    Bingo! My terabyte Mac USB drive is causing the problem-- but I need the drive connected. Any way to overcome this problem?
    OK, I just conducted a very unscientific experiment, which was to drop a 1TB drive into my USB toaster and see if I could get the computer to sleep, which I could do without a problem.  (I hooked up to the front-panel USB spigot on the machine.) 
    I am assuming that your external drive is not bus powered?  (Not sure the USB spec has enough oomph to spin a 1TB anyway, so this is probably correct.)
    Just for kicks, what is the status of your Energy Saver "Put the hard disk(s) to sleep when possible" checkbox?  Checked or not?
    Ah, and finally, what is the brand and model of the external drive?

  • Hangouts causes Chromium/Chrome to not shut down properly

    Every time I run Chromium or Chrome after logging in, I get an error saying that the program did not shut down properly, and it asks if I would like to restore the windows that were loaded when it did not shut down properly (even though I shut the app down like normal every time). I have narrowed this down to an extension issue, and the problem only being with Hangouts. If I disable the official Hangouts plugin, the problem stops, but enabling it again will cause the problem to start again. I only get this error if I log out of my user account and log back in, or if I reboot my computer. It actually doesn't seem to cause any functional problem, it's just a bit annoying.

    @gnunn thanks a lot, that is actually what I was looking for. Temp fix anyway.
    Pse wrote:
    bulletmark wrote:
    This is a bug that has existed with Chrome and Arch for about the last 3 months. Not sure if the bug is within Chrome or GNOME. I just press that Restore button every time but it is damn ugly.
    PS Edit: I just remembered somebody, possibly on this forum, suggesting the problem was within systemd or gdm not waiting long enough for Chrome to shut down.
    I don't think that's the case here. The OP said he has the problem even when closing Chromium manually.
    FWIW, I'm on Gnome 3 and I can confirm that closing the browser using Ctrl+Shift+Q works (i.e. no "restore" option afterwards, all tabs automatically restored) but shutting down Gnome without closing Chromium first causes the "restore" option to appear next time.
    Still, Gnome does not close it properly, although disabling the Chrome/ium background operations will fix the problem, it won't address the problem on its own.
    I wonder if this is stuff that Gnome devels need to be aware of.

Maybe you are looking for

  • 3000 n200 0769-BRG upgrade options and poss duff microphone

    Hi all nice forum,                            I recieved a 3000 n200 0769-BRG (TY2BRUK) for my birthday last week and after getting rid of Vista and installing xp pro am very pleased with it. Quick couple of questions however;  The microphone is extr

  • SSRS Subscriptions help

    Hello all, I need help in creating report subscription  to run on every Wednesday for Year to last Friday.So we were to generate the report next week, we should generate it for 01/01/2014- 06/06/2014. I am new to SSRS subscriptions. Please help. Than

  • I am unable to install OS X 10.9.2 along with iTunes 11.1.5

    I have been unable to install the OS X 10.9.2 along with iTunes 11.1.5

  • Auto Id as Non-Qualifer

    Hi Guys I already open a thread on this topic but maybe I was not so clear on the issue. Can some please tell us how we can use a Auto Id filed as the Non-Qualifier field in a Qualified lookup table? All other fields in the same lookup table we want

  • PCA Integration with COPA

    Hi Gurus, I need some document on PCA Integratiion with COPA.  This is urgent. Thanks in advance Surya