【发布时间】:2011-05-23 07:40:30
【问题描述】:
我有一个关于 Tomcat 线程创建的基本问题。每个浏览器实例是在单个线程上运行还是产生多个线程来处理单个浏览器实例请求?
我在代码中引用当前线程并调用 activecount 方法,它显示 20 表示 20 个活动线程。所以我怀疑这个值是从哪里配置的。是否有任何参数可以设置每个活动线程
while (iter.hasNext()) {
GrammarSection agrammarSection= null;
try {
agrammarSection = (GrammarSection) iter.next();
} catch (Exception e) {
System.out.println("DDD if it come in exception "+Thread.currentThread());
System.out.println("DDD if it come in exception "+Thread.activeCount()); //IT PRINTS 20
【问题讨论】:
-
如果您使用 JConsole 或 JVisualVM 等工具,您将能够轻松(通过 GUI)查看活动线程并了解它们是什么。