java进程中有很多线程 [英] A lot of threads in java process

查看:132
本文介绍了java进程中有很多线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么一个简单的Java GUI应用程序创建了这么多线程?

Why does a simple Java GUI application create so many threads?

推荐答案

Java使用线程做很多事情:

Java uses threads for a lot of things:


  • 应用程序的主线程,当然

  • 应用程序启动的任何线程(例如SwingWorker)

  • Swing有一个单独的事件派遣线程以及一些其他管家线程

  • 计时器,其中一些可能会隐式启动

  • 一个垃圾收集的更多主题

  • 我认为通常有一个单独的线程准备运行shutdown hooks

  • 其他JVM内部事物

  • The application's main thread, of course
  • Any threads the application starts (e.g. SwingWorker)
  • Swing has a separate Event dispatch thread as well as some other housekeeping threads
  • Timers, some of which may get started implicitly
  • One or more threads for Garbage collection
  • I think there's usually a separate thread prepared to run shutdown hooks
  • Other JVM-internal things

这篇关于java进程中有很多线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆