我有一個關於Tomcat線程創建的基本問題。每個瀏覽器實例是在單個線程上運行還是產生多個線程來處理單個瀏覽器實例請求?在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)查看活動線程並查看它們是什麼。 – Mikaveli 2011-05-23 08:30:10