Can't kill a running thread...

I'm having some problems killing a thread. Becuase thread.stop() is no longer used, I basically set a flag to tell all the threads to return by checking this flag in the run() method. The problem now is that there is a thread that is getting "stuck" in a class that I have no access to. So basically I assume that its a really long loop, or an infinite loop... either way, that thread doesn't stop even if the "parent" (spawning) thread is "stopped". Any suggestions?
-L

Java's Thread Tutorial
JavaWorld: Introduction to Java threads
IBM: Introduction to Java threads
Google: java+threads+tutorial
Why Are Thread.stop, Thread.suspend, Thread.resume and Runtime.runFinalizersOnExit Deprecated?

Similar Messages

  • Can I  kill services running behind photoshop?

    I can see the following services running behind photoshop even after exiting the application.
    VulcanMessageCmd.exe*32
    CS6ServiceManager.exe*32
    SwitchBoard.exe*32
    Can I force close them while bridge or photoshop running? This is my requirement in app-v because when I exit the bridge,photoshop these processes run behind which doesn't allow my virutal bubble to shutdown.
    So please suggest if I can close all these processes even if photoshop is running?
    Actually I killed these processes from task manager but didn't affect photoshop application. But just want to make sure force closing these processes wont break the running application.
    Thanks,
    Venkat.

    No risk in shutting them down when your environment is closed, anyway. They're just helper bunnies that provide access to web services and the Adobe ID and manage updates.
    Mylenium

  • Killing a Swing thread

    Hello,
    How can I kill a Swing thread? For example the program below would never exit. Sure you can type System.exit(0) which would exit anything, but what are the other solutions?
    I tried putting chooser = null;
    System.gc();in the end of main() but this won’t work.
    To formulate my question better - how would I kill a thread I do not have complete command of (i.e. I can’t do usual do/while thread stopping)?
    Big thanks in advance.
    public class SwingLiveTest{
        public static void main(String[] args) {
            JFileChooser chooser = new JFileChooser();
            if (chooser.showSaveDialog(null) != JFileChooser.APPROVE_OPTION) return;
            File file = chooser.getSelectedFile();
            System.out.println(file);
            /*chooser = null;
            System.gc(); */

    You can't kill any Thread like this, at least not those where there is no method to call.
    It is possible to cause a Thread to stop, call the stop method, however this is not the recommended approach for very good reasons (Read the JavaDocs for java.lang.Thread.stop() method to see why.
    It should be possible, once you have obtained a reference to the Thread you wish to stop, to call interrupt() on that Thread.
    This is not guaranteed to work because you are dependent on the implementation of the Thread class you are manipulating or the Runnable that the Thread instance is currently running.
    There may be classes in the com.sun packages which can aid you with this problem, this is where Sun usually sticks undocumented implementation however these packages are not officially supported and there is no guarantee that classes you use in one VM are available in another, in particular when the VM you are using is not a Sun VM.

  • How can I kill all Threads of the same class from within the run() method?

    Ok
    I have a class called Consumer that extends Thread
    I have several Consumer threans running... but, when a certain condition is true (within the run() method) in ANY of the threads, I want to kill ALL the threads of that object.
    is this possible?

    I know this is gonna be too demanding, but can someone please tell me why my Consumer's run() method never reaches the System.out.println( "ALL CONSUMING DONE") line
    Create a multi-threaded prime number calculator that is based on the producer-consumer model
    using semaphores. Your program should be able to check for prime numbers in a range specified
    by the user and with a variable number of threads. Example:
    $ java PrimeFind 3 5000 10000
    should use 1 producer and 2 consumers (3 threads in total, obviously the minimum is 2) to find all
    the prime numbers in the range [5000,10000].
    The producer should: use a buffer to store candidate numbers that have to be checked for
    primality.
    Consumers should: read from the buffer, check if a number is prime and update the status of the
    program accordingly (e.g. show the number on the screen, or save it to a file)
    import java.util.concurrent.Semaphore;
    import java.io.*;
    public class Assign1 {
    static int fromThisNumber;
    static int toThisNumber;
    static int numberOfThreads;
    static int buffer[];
    static Semaphore ready;          /*This semaphore is used by the Producer to signal
                                         an "OK" to the consumers*/
    static Semaphore critical;  /*This is a Mutex semaphore. It allows only 1 consumer
                                         to enter his critical section.
    static Semaphore counter;     /*This semaphore acts as a counter.
                                        Instead of having a global variable
                                         incremented each time, we just release()
                                         this semephore when we find a prime number
                                         Because remember that release() increments permits
    static Producer prod;
    static Consumer cons[];
    static int in=0;
    static int out=0;
    static PrintWriter outFile;
         public static void main (String args[]){
              try{
                   outFile=new PrintWriter(new FileWriter("primes.txt"));
                   }catch(Exception e){}
              numberOfThreads=Integer.parseInt(args[0]);
              fromThisNumber=Integer.parseInt(args[1]);
              toThisNumber=Integer.parseInt(args[2]);
              buffer=new int[Integer.parseInt(args[2])-Integer.parseInt(args[1])+1];
              ready=new Semaphore(0,false); /*We initialise it to 0 because we wait
                                                      for the Producer to produce atleast a
                                                      item. Suppose ready was 1 and if
                                                      Consumer ran first he would be in an
                                                      empty buffer */
              critical=new Semaphore (1,false);/*We initialise it to 1 because when
                                                         the first Consumer thread tries
                                                         to enter its critical section, it
                                                         should be allowed to;
                                                         Subsequent threads will have to
                                                         wait since only 1 thread can
                                                         access its critical section at a time*/
              counter=new Semaphore(0,false); // duh!
              cons=new Consumer[numberOfThreads-1]; /*numberOfThreads-1 because 1 thread
                                                                is taken by the Producer*/
              //Creating Producer object
              prod=new Producer();
              //Creating the Consumer object and start the thread.
              for(int i=0;i<cons.length;i++)
                        cons=new Consumer();
                        cons[i].start();
              prod.start();          
              //Printing to screen and file
    /*          for(int i=0;i<buffer.length;i++)
                   if(buffer[i]!=0)
                             System.out.println(buffer[i]);
                             outFile.println(buffer[i]);
              System.out.println("Total primes found between "+args[1]+" and "+toThisNumber+": "+counter.availablePermits()+"\n primes.txt written");
              outFile.println("Total primes found between "+args[1]+" and "+toThisNumber+": "+counter.availablePermits());
              outFile.close();*/                    
    static class Producer extends Thread {
         public void run(){try{
              while(in<buffer.length)     /*'in' should always be more than 'out'.Oherwise the consumer will try to access an empty index*/
                   {     System.out.println("producing");     
                        buffer[in]=fromThisNumber;
                        in++;
                        fromThisNumber++;
                        ready.release();
              catch (Exception e){e.printStackTrace();}
              System.out.println("ALL PRODUCING DONE");
    static class Consumer extends Thread {
         int tempout=0;
         public void run(){try{
              System.out.println("before while"+this.getId());
              while(tempout<=in)
                   System.out.println("before ready"+this.getId()+" "+ready.availablePermits()+" "+in);
                   ready.acquire();
                   System.out.println("before critical.acquire"+this.getId());
                   critical.acquire();
                   tempout=out;
                   out++;
                   critical.release();               
                   if(!isPrime(buffer[tempout]))
                        {System.out.println(buffer[tempout]+" by "+this.getId());buffer[tempout]=0;}
                   else {counter.release();System.out.println("prime added: "+buffer[tempout]+" by "+this.getId());}
                   critical.acquire();
                   tempout=out;
                   System.out.println("tempout:"+tempout+" of "+this.getId());
                   critical.release();
              System.out.println("ALL CONSUMING DONE"+this.getId());
         catch(Exception e){e.printStackTrace();}
         //Prime number-checking method     
         public boolean isPrime(int n){
              for(int i=2;i<=(n/2);i++)
                   if(n%i==0)
                        return false;
              return true;
    ======================
    import java.util.concurrent.Semaphore;
    import java.io.*;
    /* 3 questions to ask Barlas
    * Why error if I start the Consumer threads before Producer
    * Why does the counter semaphore always give a +1 result at the end
    * Is there a way I can verify that all the work is not being done by only 1 consumer thread? In other words, the workload is being shared properly
    * if I put ready.acquire() outside or inside the while loop, its not making any difference, why?
    * Strangely, its not making any difference if I playing with the release() and aquire() of the semaphores, WHY?!?!
    public class Assign1 {
    static int fromThisNumber;
    static int toThisNumber;
    static int numberOfThreads;
    static int buffer[];
    static Semaphore ready;          /*This semaphore is used by the Producer to signal
                                       an "OK" to the consumers*/
    static Semaphore critical; /*This is a Mutex semaphore. It allows only 1 consumer
                                       to enter his critical section.
    static Semaphore counter;     /*This semaphore acts as a counter.
                                  Instead of having a global variable
                                       incremented each time, we just release()
                                       this semephore when we find a prime number
                                       Because remember that release() increments permits
    static Producer prod;
    static Consumer cons[];
    static int in=0;
    static int out=0;
    static PrintWriter outFile;
         public static void main (String args[]){
              try{
                   outFile=new PrintWriter(new FileWriter("primes.txt"));
                   }catch(Exception e){}
              numberOfThreads=Integer.parseInt(args[0]);
              fromThisNumber=Integer.parseInt(args[1]);
              toThisNumber=Integer.parseInt(args[2]);
              buffer=new int[Integer.parseInt(args[2])-Integer.parseInt(args[1])+1];
              ready=new Semaphore(0,false); /*We initialise it to 0 because we wait
                                                      for the Producer to produce atleast a
                                                      item. Suppose ready was 1 and if
                                                      Consumer ran first he would be in an
                                                      empty buffer */
              critical=new Semaphore (1,false);/*We initialise it to 1 because when
                                                      the first Consumer thread tries
                                                      to enter its critical section, it
                                                      should be allowed to;
                                                      Subsequent threads will have to
                                                      wait since only 1 thread can
                                                      access its critical section at a time*/
              counter=new Semaphore(0,false); // duh!
              cons=new Consumer[numberOfThreads-1]; /*numberOfThreads-1 because 1 thread
                                                                is taken by the Producer*/
              //Creating Producer object
              prod=new Producer();
              //Creating the Consumer object and start the thread.
              for(int i=0;i<cons.length;i++)
                        cons[i]=new Consumer();
                        cons[i].start();
              prod.start();          
              //Printing to screen and file
    /*          for(int i=0;i<buffer.length;i++)
                   if(buffer[i]!=0)
                             System.out.println(buffer[i]);
                             outFile.println(buffer[i]);
              System.out.println("Total primes found between "+args[1]+" and "+toThisNumber+": "+counter.availablePermits()+"\n primes.txt written");
              outFile.println("Total primes found between "+args[1]+" and "+toThisNumber+": "+counter.availablePermits());
              outFile.close();*/                    
    static class Producer extends Thread {
         public void run(){try{
              while(in<buffer.length)     /*'in' should always be more than 'out'.Oherwise the consumer will try to access an empty index*/
                   {     System.out.println("producing");     
                        buffer[in]=fromThisNumber;
                        in++;
                        fromThisNumber++;
                        ready.release();
              catch (Exception e){e.printStackTrace();}
              System.out.println("ALL PRODUCING DONE");
    static class Consumer extends Thread {
         int tempout=0;
         public void run(){try{
              System.out.println("before while"+this.getId());
              while(tempout<=in)
                   System.out.println("before ready"+this.getId()+" "+ready.availablePermits()+" "+in);
                   ready.acquire();
                   System.out.println("before critical.acquire"+this.getId());
                   critical.acquire();
                   tempout=out;
                   out++;
                   critical.release();               
                   if(!isPrime(buffer[tempout]))
                        {System.out.println(buffer[tempout]+" by "+this.getId());buffer[tempout]=0;}
                   else {counter.release();System.out.println("prime added: "+buffer[tempout]+" by "+this.getId());}
                   critical.acquire();
                   tempout=out;
                   System.out.println("tempout:"+tempout+" of "+this.getId());
                   critical.release();
              System.out.println("ALL CONSUMING DONE"+this.getId());
         catch(Exception e){e.printStackTrace();}
         //Prime number-checking method     
         public boolean isPrime(int n){
              for(int i=2;i<=(n/2);i++)
                   if(n%i==0)
                        return false;
              return true;
    ===========================
    BTW, when I tried to change extends Thread to implements Runnable I got some kinda of error.
    Actually, my program is pretty complete... its just that something if messed up in my Consumer's run() method's while loop... I think
    I know guys its crazy to ask ya'll to look at so much code, but.... I'd really appreciate it. This assignment is killing me, been at it since 10 hours now....

  • How can a thread kill another blocked thread?

    Hello All,
    As the title mentioned, lets say i have a main class in which i created a new thread but for some reason, this thread is blocked so i want to find a way to kill this thread from the main class (the interrupt function is not working), is there a workarround to do this?
    Thank you in advance

    Hello,
    First of all, thanks for you interventions, i think i should clearify my case:
    I have a website which has a "Search the site" feature where a user can search the site for specific keywords
    The search engine is an external jar which we use by calling its API, but for some reason this search engine becomes blocked sometimes so my jsp which is calling this API gets also blocked and any subsequent search gets also blocked in the end the number of java threads becomes very high in my system!
    i want to find a way so that if the piece of code calling the search API didnt get excuted during a specific period, i want to kill the thread calling the search API
    lets say the search form is submitted to the following jsp
    // Here we have a SearchThread extends Thread
    /* i launched a new Thread to do the search independatly from the main process*/
    SearchThread task = new SearchThread("search_input");
    task.start();
    /* In the searchThread class we have a run method containing the following line which calls the search API, for some reason , this line never returns and keeps the thread in Running state and so the run() method never returns and so the thread will neve be dead :( */
    SearchLoginSession = new SearchLoginSession (configFile, true);
    Notes:
    1) the stop is deprecated i cant use it
    2) the suspend method will suspend it and not kill it, the thread will remain in memory
    3) the interrupt method didnt work
    4)i am working in a multi-cpu environment
    Finally , what i want is to find a way to remove this thread from memory from the main jsp listed above like
    task.kill() or some workarround
    Thank you for reading and hope you can help me

  • Hi i have 50 infoobjects as part of my aggregates and in that 10 infoobjects have received changes in masterdata.so in my process chain the Attribute change run in running for a long time.can i kill the job and repeat the same.

    Hi i have 50 infoobjects as part of my aggregates and in that 10 infoobjects have received changes in masterdata.so in my process chain the Attribute change run in running for a long time.can i kill the job and repeat the same.

    Hi,
    I believe this would be your Prod system, so don't just cancel it but look at the job log. If it is still processing then don't kill it and wait for the change run to complete but if you can see that nothing is happening and it is stuck for a long time then you can go ahead and cancel it.
    But please be sure, as these kind of jobs can create problems if you cancel them in the middle of a job.
    Regards,
    Arminder Singh

  • Can a parent thread kill a child thread?

    I'm writing a multi-threaded application in which it is possible for one of the threads to go into an infinite loop. Is there any way for a parent thread to actually kill the child thread that has gone into the infinite loop? Of course the parent thread won't actually be able to discern whether or not the child thread is in an infinite loop. I would specify some time out value, and when it has been exceeded, then I would want to kill the child thread. Is this possible without setting any sort of flag that the child would read, because once it gets stuck inside an infinite loop, there will be no way to read the flag.

    Here's an example of a program that I wrote to simply ping a server. It works somewhat backwards from what you were looking for (the child interrupts the parent) but should provide some clue:
    import java.net.*;
    import java.io.*;
    import java.util.Date;
    public class ServerPing extends Thread {
      String [] args;
      public static void main(String[] args) throws Exception {
        ServerPing sp = new ServerPing(args);
        sp.start();
      ServerPing(String [] args) {
        this.args = args;
      public void run() {
        Pinger pinger = new Pinger(this);
        pinger.start();
        try {
          sleep(30000);
        catch (InterruptedException x) {
          System.exit(0); // this is ok. It means the pinger interrupted.
        System.out.println("TIMEOUT");
        System.exit(1);
    class Pinger extends Thread {
      Thread p = null;
      Pinger (Thread p) {
        this.p = p;
      public void run() {
        try {
          URL simpleURL = new URL("http://localhost:7001/ping.jsp");
          BufferedReader in = new BufferedReader(new InputStreamReader(simpleURL.openStream()));
          String inputLine;
          while ((inputLine = in.readLine()) != null)
          System.out.println(inputLine);
          in.close();
          p.interrupt();   // <<-- interrupt the parent
        catch (Exception x) {
          x.printStackTrace();
    }

  • [SOLVED] X hang * can't kill * kbd/mouse disabled

    Arch newbie.  New install of Arch 2009.02 FTP i686 on test hardware that successfully runs many Linux distros (Ubuntu Intrepid & all previous, Mepis, Fedora, Puppy, SliTaz, DSL, and many more.)
    Followed Install Guide and Beginner's Guide.  All is well until I get to X.
    I did not install libgl because I shouldn't need 3D for this old box.  Installed xorg & mesa (not sure if needed).  Did "lspci | grep VGA" and got "VGA compatible controller: 3Dfx Interactive, Inc. Voodoo Banshee (rev 03)"
    Copied over working xorg.conf from another distro on same box.  No video driver in xorg.conf.  Wasn't sure if correct driver was xf86-video-voodoo.  Wrong.  Tried xf86-video-tdfx.  Appeared to be correct.  Tried xterm test, got white xterm box & prompt, but kbd & mouse inoperative.  Couldn't kill X.
    Removed ...tdfx and ...vesa drivers & did fresh install of ...vesa.  Ran "Xorg-configure" followed by "X -config /root/xorg.conf.new"  Still hangs and can't kill X.
    Checked the Xorg.0.logs (saved from several attempts).  Keep getting
    (WW) AllowEmptyInput is on, devices using drivers 'kbd' or 'mouse' will be disabled.
    (WW) Disabling Mouse0
    (WW) Disabling Keyboard0
    Googled for - "xorg hang 'AllowEmptyInput is on'"  Found a few mentions, including one on Arch bbs, but they were very heavy going and I don't understand them.  Not having a kbd appears to be the reason I can't kill X.
    One (EE) error --
    (WW) Warning, couldn't open module freetype
    (II) UnloadModule: "freetype"
    (EE) Failed to load module "freetype" (module does not exist, 0)
    (II) LoadModule: "vesa"
    Can anyone suggest an approach to debugging these issues?
    Last edited by secdroid (2009-04-12 18:00:25)

    Appreciate the help.  Here's what I did --
    --- pacman -S xf86-input-evdev
    --- pacman -S xf86-video-tdfx   #(note: re-install)
    --- Added hal to DAEMONS section of rc.conf   #(note: hal starts dbus)
    --- Since default is US kbd, I didn't need to do any of the config steps in "Configuration section of http://wiki.archlinux.org/index.php/Xor … us_in_Arch
    X now started and stopped normally.  Did "Simple Baseline X Test" (xterm) successfully. 
    Did pacman -S lxde and tried to start X.  Failed because fam was not running.  Added fam to DAEMONS and I now have a working LXDE.  Still needs tweaks, of course, but I'm up!
    FWIW, "freetype" doesn't appear to be in xorg.conf.  Since it appears to be a non-critical "(EE)" X error, I'll pursue it later.
    Suggestions for "Beginners Guide" --
    --- Beginners really need pointer to http://wiki.archlinux.org/index.php/Xor … us_in_Arch in case of X start failures
    --- LXDE section is extremely weak compared to Arch wiki resources.  Suggest replacing current Beginners Guide LXDE materials with pointers to http://wiki.archlinux.org/index.php/LXDE and http://wiki.lxde.org/en/Main_Page
    Moderator: Please tag this thread as [SOLVED]  I would, if I knew how.

  • Creating exception in a running thread

    what are the various way i can create an exception inside a running thread. (without using any Thread's interuption method) ? i want to interupt my thread . what are the ways ?

    PS If you mean you want to STOP the thread using an exception that will occur while it's running then - don't do that. The appropriate way to kill such a thread is to set a flag which your run method checks to determine if it should exit.
    D.

  • Killing an anonymous Thread

    Hi,
    The question is: How can we kill a Thread that we don't have any reference to it.
    I have a "closed" jar which launches two threads that don't die after the function execution. I cannot kill the JVM by invoking System.exit[0].
    Is there any possibility to access the Threads that are running in memory and kill them? If so how?

    Hi ChuckBing,
    Thanks for replying. Well, actually I think you missunderstood the problem. Let me give you an exemple:
    public class Test {
         public static void main(String[] args) {
              (new DontKillThisAnonymousThread()).start();
              (new KillMeThreadLauncherThread()).start();
    class DontKillThisAnonymousThread extends Thread{
         public void run(){
              try{
                   while(true){
                        System.out.println("I want to live forever...");
                        //From this single line of execution
                        //how can I find another thread (an anonymous one) and kill it.
                        sleep(1000);
              }catch(InterruptedException e){
                   e.printStackTrace();
    class KillMeThreadLauncherThread extends Thread{
         public void run(){
              (new KILL_ME_AnonymousThread()).start();
    class KILL_ME_AnonymousThread extends Thread{
         public void run(){
              try{
                   while(true){
                        System.out.println("Are you able to kill me without killing the JVM...");
                        sleep(1000);
              }catch(InterruptedException e){
                   e.printStackTrace();
    }Thanks

  • Where we can know about the stuck threads without taking thread dump.

    Hi Everyone,
    Where we can View/know about the stuck threads without taking thread dump.
    Thank You

    Hi!
    WebLogic Server diagnoses a thread as stuck if it is continually working (not idle) for a set period of time. You can tune stuck threads in the Weblogic Server.
    You can tune a server’s thread detection behavior by changing the length of time before a thread is diagnosed as stuck, and by changing the frequency with which the server checks for stuck threads.
    It can be configured using below mentioned 2 parameters. These can be configured from Admin console -> Servers ->Configuration > Tuning tab.
    1)Stuck Thread Max Time
    2)Stuck Thread Timer Interval
    Although you can change the criteria WebLogic Server uses to determine whether a thread is stuck, you cannot change the default behavior of setting the “warning” and “critical” health states when all threads in a particular execute queue become stuck.
    There is a parameter "Stuck Thread Count" which can be configured from Console
    (Servers -> Configuration ->Overload -> Stuck Thread count) which helps to transition the Server to FAILED state once the stuck threads reaches the value.
    You can also use "OverloadProtectionMBean" for tuning. In Weblogic Server 9.x and later, it is recommended that you use the "ServerFailureTriggerMBean" in the "OverloadProtectionMBean".The ServerFailureTriggerMBean transitions the server to a FAILED state after the specified number of stuck threads are detected.The OverloadProtectionMBean has options to suspend or shutdown a failed server.
    WebLogic Server checks for stuck threads periodically. If all application threads are stuck, a server instance marks itself failed, if configured to do so, exits. You can configure Node Manager or a third-party high-availability solution to restart the server instance for automatic failure recovery.
    You can configure these actions to occur when not all threads are stuck, but the number of stuck threads have exceeded a configured threshold:
    - Shut down the Work Manager if it has stuck threads. A Work Manager that is shut down will refuse new work and reject existing work in the queue by sending a rejection message. In a cluster, clustered clients will fail over to another cluster member.
    - Shut down the application if there are stuck threads in the application. The application is shutdown by bringing it into ADMIN mode. All Work Managers belonging to the application are shut down, and behave as described above.
    - Mark the server instance as failed and shut it down it down if there are stuck threads in the server. In a cluster, clustered clients that are connected or attempting to connect will fail over to another cluster member.
    You can configure the "ServerFailureTriggerMBean" in the "OverloadProtectionMBean".
    Below is documentation link for "ServerFailureTriggerMBean" methods.
    http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13945/weblogic/management/configuration/ServerFailureTriggerMBean.html
    You can use getStuckThreadCount() method to check the number of stuck threads and transition the server to Failed State once itreaches the limit.
    getStuckThreadCount:
    int getStuckThreadCount() - The number of stuck threads after which the server is transitioned into FAILED state. There are options inOverloadProtectionMBean to suspend and shutdown a FAILED server. By default, the server continues to run in FAILED state. If the StuckThreadCount value is set to zero then the server never transitions into FAILED server irrespective of the number of stuck threads.
    Returns:
    The StuckThreadCount value
    Default Value:
    0
    Maximum Value:
    java.lang.Integer.MAX_VALUE
    Minimum Value:
    0
    Below is documentation link for "OverloadProtectionMBean" methods.
    http://download.oracle.com/docs/cd/E11035_01/wls100/javadocs_mhome/weblogic/management/configuration/OverloadProtectionMBean.html
    In the Admin console, you can set the "FailureAction" under Servers->Configuration->Overload to force shutdown the managed server once the server is in Failed state.
    The OverloadProtectionMBean has a method getFailureAction to achieve the same.
    getFailureAction:
    String getFailureAction() - Enable automatic forceshutdown of the server on failed state. The server self-health monitoring detects fatal failures and mark the server as failed. The server can be restarted using NodeManager or a HA agent.
    Valid Values:
    OverloadProtectionMBean.NO_ACTION, OverloadProtectionMBean.FORCE_SHUTDOWN, OverloadProtectionMBean.ADMIN_STATE
    If you start the managed servers using node manager, you can enable "Auto Kill if Failed" and "Auto Restart" in the Admin console, under Servers-> configuration->Health Monitoring. Node Manager will take care of restarting the managed server if you enable "Auto Restart".
    You can also configure the "Stuck Thread Count" and "Failure Action" to "Force Immediate shutdown of the Server" from Admin console under servers-> configuration-> Overload. This will help you to shutdown the server when the stuck thread count is reached. But there is no way to release the threads once they are stuck from the configuration.
    Suppose if you set the value of the Stuck Thread Count to 20, The server will be transitioned to failed state once the count reaches 20 and if you enable the Failure Action, the server self-health monitoring detects fatal failures and mark the server as failed.
    Depending on how you are starting the servers (custom scripts or Node Manager or startup scripts,...), you can restart the servers.
    For more details on this please refer to below link:
    http://www.oracle.com/technetwork/articles/entarch/workload-management-088692.html
    Hope this helps.
    Thanks,
    Cris

  • Stop the running Thread

    Hi
    i am calling the thread .in the midlle of running thread i have to stop the thread .please help me .
    my senario like . I am calling the scripts . i am wating certain period to complete the script exection . if the scripts are not available its still wating for a long time . so i am using the thread to execute the scripts and (main thread )checking each duration is completed or not . if the duration completed i am stoping the thread with Thread.Stop() method . but the thread still is alive . next time when i call Thread.Start() its throwing "java.lang.IllegalThreadStateException".
    please help me this .
    Thanks in advance
    public class TestCaseScriptProcessor extends Thread {
    public String execute(){
    TestCaseScriptProcessor caseScriptProcessor = new TestCaseScriptProcessor();
    caseScriptProcessor .start();// second time throwing java.lang.IllegalThreadStateException.
    while (!isExpired) {
    caseScriptProcessor.stop();
    public void run() {
    Edited by: 849614 on Jan 17, 2013 6:17 AM
    Edited by: 849614 on Jan 17, 2013 6:22 AM

    What exactly are you trying to do? Calling Thread.stop( ) is inherently a bad idea (see the Javadocs).
    You are getting a IllegalStateException because Thread.stop( ) kills the thread, you would need to create a new thread to resume execution.
    If what you are trying to do is pause execution, you probably want to redesign your thread's tasks into smaller chunks that can be launched separately. Alternatively, have the thread check it's interrupted state and if a flag was set block on a monitor until you want it to resume execution.

  • Long running threads (Jasper Reports) and AM-Pooling

    Hi,
    we are developing quite large application with ADF an BC. We have quite a lot of reports generated through Jasper that take quite long time to complete. The result is a PDF document that user gets on the UI so he can download it over download link. Reports that take over an hour to finish are never completed and returned to the user on UI. I think the problem is in AM-Polling because we are using default AM-Polling settings:
    <AM-Pooling jbo.ampool.maxinactiveage="600000" jbo.ampool.monitorsleepinterval="600000" jbo.ampool.timetolive="3600000"/>
    The AM is destroyed or returned to pool before reports finishes. How to properly configure those settings that even long running threads will do there jobs to the end.
    We also modified web.xml as follows:
      <session-config>
        <session-timeout>300</session-timeout>
      </session-config>
    Any help appreciated.
    Regards, Tadej

    Your problem is not related to ADF ApplicationModules. AMs are returned to the pool no earlier than the end of request, so for sure they are not destroyed by the framework while the report is running. The AM timeout settings you are referring to are applicable only to idle AMs in the pool but not to AMs that have been checked out and used by some active request.
    If you are using MS Internet Explorer, then most probably your problem is related to the IE's ReceiveTimeout setting, which defines a timeout for receiving a response from the server. I have had such problems with long running requests (involving DB processing running for more than 1 hour) and solved my problem by increasing this timeout. By default this timeout is as follows:
    IE4 - 5 minutes
    IE5, 6, 7, 8 - 60 minutes
    I cannot find what the default value is for IE9 and IE10, but some people claim it is only 10 seconds, although this information does not sound reasonable and reliable! Anyway, the real value is hardly greater than 60 minutes.
    You should increase the ReceiveTimeout registry value to an appropriate value (greater than the time necessary for your report to complete). Follow the instructions of MS Support here:
    Internet Explorer error &quot;connection timed out&quot; when server does not respond
    I have searched Internet for similar timeout settings for Google Chrome and Mozilla Firefox, but I have not found anything, so I instructed my customers (who execute long-running DB processing) to configure and use IE for these requests.
    Dimitar

  • Script to kill long running reports in OBIEE

    Hi
    I have requirement to kill long running reports . I am using OBIEE version 10.1.3.4.0 which has a bug where it is not taking query limits governor and the reports are not getting killed if i am setting that parameter in RPD.
    Oracle support has advised me to upgrade to next version, but for now, i cannot upgrade.
    Can anyone suggest me script to run on obiee app server that can kill long running reports on obiee and database server.
    I have AIX server and all reports run on database with same functional ID that is being used for ETL as well to Analytics database.

    Shikhs17 wrote:
    Hi
    I have requirement to kill long running reports . I am using OBIEE version 10.1.3.4.0 which has a bug where it is not taking query limits governor and the reports are not getting killed if i am setting that parameter in RPD.
    Oracle support has advised me to upgrade to next version, but for now, i cannot upgrade.
    Can anyone suggest me script to run on obiee app server that can kill long running reports on obiee and database server.
    I have AIX server and all reports run on database with same functional ID that is being used for ETL as well to Analytics database.Do you want to enforce the limitation on the database to automatically kill running sessions that run over specific period of time?

  • Does win8/8.1/10 kill long-running programs automatically as stated in specs? reasons why?

    does win8/8.1/10 kill/end-task long-running programs automatically as stated in specs? how specifically does it detect a locked-up process?
    has this been put into windows 7 at any time to make it similar to windows 8?
    Please supply accurate answers. thank you.
    My understanding the reason for this change was to handle locked-up programs.
    I do have a number of long-running processes. some examples of mine and scenarios for other users:
    simulations on a Workstation or HPC Server
    doing a directory tree walk on a hard disk with >=1TB of data
    reference articles I have found on the subject:
    windows 7
    http://windows.microsoft.com/en-us/windows/exit-program-not-responding#1TC=windows-7
    windows 8
    From some of what I understand, you can also get the "Program Not Responding" or similarly titled dialog box when:
    bug in the source code of the program in question. for instance, while(1){} such as forever loops (win7)
    similar program bug when declaring a function one way but defining it a different way and then calling it (mismatch in function signature) (win7)
    similar to above with DLLs in using MSVCRT*.DLL or other
    (?) can't remember for sure on this, but I think some badly formed calls or it was invalid values or data type mismatch to Win32 API can do this from buggy code. (win7)
    for (x=0; x < 16777216; x++) {your code here...} in other words, large values for loop termination (win7)
    this is a repost of http://answers.microsoft.com/en-us/windows/forum/windows_8-performance/does-win88110-kill-long-running-programs/d35c3c9e-c6f4-4bbf-846a-2041bf2167a0?tm=1427518759476
    here due to a request to do so.

    does win8/8.1/10 kill/end-task long-running programs automatically as stated in specs? how specifically does it detect a locked-up process?
    has this been put into windows 7 at any time to make it similar to windows 8?
    Please supply accurate answers. thank you.
    My understanding the reason for this change was to handle locked-up programs.
    Hi Jim,
    First, I have to admit that I'm not fully understanding the question, If a program is not responding, it means the program is interacting more slowly than usual with Windows, typically could be a confliction of software or hardware resources between
    two programs, lack of system resources, or a bug in the software or drivers. In that case, we can choose to wait or end the program. This design is similiar in Windows 7, Windows 8 and other OS.
    For deeper analysis, system determines whether the system considers that a specified application is not responding using a "IsHungAppWindow function",
    https://msdn.microsoft.com/en-us/library/ms633526.aspx
    And this link also give some explanation: Preventing Hangs in Windows Applicationshttps://msdn.microsoft.com/en-us/library/windows/desktop/dd744765%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
    While I'm not a developer, to better understand this, I recommend you contact members in the MSDN Forum:
    https://social.msdn.microsoft.com/Forums/en-US/home
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Maybe you are looking for

  • How can I integrate an excel spreadsheet to div tags?

    I am a high school student and we are having a "contest" Whoever can make the best website for our school will have their website published and will not have to take the final exam. I believe that mine is the best in the class so far but there is one

  • How to use Boot Camp without USB drive?

    Hi Trying to install Windows via BootCamp, I came across a real nuisance: where I am, the only way to connect to the Internet is using a dongle. When the dongle is in, there's no way to squeeze another USB plug next to it; hence I can't let BootCamp

  • Value help in a disabled field?

    Hi all, In a web dynpro Abap application I want to add a field with a search help(OVS). The thing is that I don't want the user to enter data in the field but he should be able to select a value using the F4 functionality. Do you think that it is pos

  • Do I have to register all *.jsp servlets in web.xml?

    All, I'm hoping someone in this forum can help me. I'm working on a report generator that uses JSP to generate a template which is fed to a formatter. What I want is to programatically call the JSP without having to add an entry for every single repo

  • MSDN Volume License

    We have a requirement to install Windows Server 2008 with Service Pack 2 (x64) - DVD (Japanese)" , however we do not have the media, can we download from MSDN and use our volume license to activate the same?