Win a copy of Microservices in Action this week in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

SwingWorker Threads  RSS feed

Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The API for SwingWorker says that it runs on a worker thread, which makes it sound like when you create multiple objects from a class that extends SwingWorker, only a limited number of threads will be created. Even in the source code, there is a constant listing a maximum number of threads.


When I profile an application that creates new SwingWorkers regularly, under threads it lists an ongoing and continually expanding list of SwingWorker threads. My guess is that many have died.

Is this something to worry about? Should I use and executor to limit the number of threads available? If I create many instances of different SwingWorkers and subclass instances, will the constant defining the maximum number of worker threads apply to all the instances? (i.e. I have 4 different subclass tasks, each with 3 instances running. Will only 10, or whatever that constant is in the SwingWorker source, be running?)


  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!