Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8699927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:04:07+00:00 2026-06-13T02:04:07+00:00

I usually run my program with about 4 threads and anywhere between 1 hour

  • 0

I usually run my program with about 4 threads and anywhere between 1 hour to 10 hours after the program is running some threads just stop and do nothing, I have my program around Exception and Throwable block and I also have a uncaughtException for the thread and nothing gets added to my log files about any errors. How can I find what is causing the threads to stop?

EDIT

Here is the basic structure of my code

Below is the code for setting the uncaughtException block

                newThread.setName("Thread" + totalNumberOfThreads);
                newThread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler()
                {
                    @Override
                    public void uncaughtException(Thread t, Throwable e)
                    {
                        Main.logger.info("ERROR! An exception occurred in " + t.getName() + ". Cause: " + e.getMessage());
                    }
                });
                newThread.start();

And this is the basic structure of the thread

@Override
public void run()
{               
  while (true)
  {
    try
    {               
      //a long section of code
    }
    catch (Exception e)
    {
      e.printStackTrace();
      Main.logger.info(threadName + ": " + e);
    }
    catch (Throwable t)
    {
      Main.logger.info(threadName + ": " + "Throwable: " + t);
    }
    finally
    {      
      //some code to close connections.. ect..
    }
  } // end while
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:04:09+00:00Added an answer on June 13, 2026 at 2:04 am

    How can I find what is causing the threads to stop?

    Do you know for a fact that the threads have stopped? As mentioned they might be blocked. You can use either jstack to see if they are active or for closer inspection start the program with remote debugging enabled and attach a debugger when you feel they have stopped.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running visual studio, and to run the program I usually just hit
Usually a java program is running with a single process called javaw.And when I
I am just a beginner of computer science. I learned something about running time
I usually run this program via a command line like so: java Program <TestClass.java
So I usually run my programs through Eclipse but I'm not allowed to use
I'm using gcc and OpenMPI . Usually I run MPI programs using the mpirun
Usually we define iis web sites which allow anonymous authentication to run under the
When I run an MSI (without parameters) I usually have to click my way
I run an ASP.NET application on IIS 6.0. Usually I have compression turned on
I've run into this in the past, but I've usually been able to design

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.