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 7050211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:06:56+00:00 2026-05-28T03:06:56+00:00

I write application in Java using ThreadPool. Firstly I create new ThreadPool: private ExecutorService

  • 0

I write application in Java using ThreadPool. Firstly I create new ThreadPool:

private ExecutorService threadExecutor = Executors.newFixedThreadPool( 20 );

Then I create some Runnable objects. After that I execute my ThreadPool from time to time passing him the same Runnable object:

threadExecutor.execute(serverRunnable);

I execute this ThreadPool every 20 seconds. My problem is that threadExecutor stops working for some 5 minutes. It just don’t execute Runnable object. I notice that when I increase argument in:

Executors.newFixedThreadPool( 20 );

from 20 to e.g. 100 ThreadPool will work longer. Can anybody explain me why ThreadPool stop working?

Ps. I write this code in Android

  • 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-05-28T03:06:57+00:00Added an answer on May 28, 2026 at 3:06 am

    firstly if you want to schedule as task for execution every 20 seconds try to use ScheduledThreadPoolExecutor instead : http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html

    It seems your runnable does not terminate – in this way it will exceed the 20 threads after a fixed amount of time. If your runnable terminates normally – you will be able to use your executor infinitely long.

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

Sidebar

Related Questions

I write application in Java using SWT. I would like to create unique file
I am trying to write some test code for my java application using Scalatest.
I am trying to write a small application using bouncycastle algorithm, from the BouncyCastleProvider.java
I want to create a hidden folder using java application. That program should work
I'm trying to enter some value in external application using Java. Java application looks
I try to generate some Excel sheets in Java application using JExcelAPI (v. 2.6.3)
I am using Java to write a media application. Given a file, how can
I'm using Eclipse to write a small Java application that uses WLST to manage
I'm trying to write a facebook application using Java tomcat with RestFB. the restfb
I am using java to create an application for network management. In this application

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.