• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ThreadGroup .activeCount()

 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a simple jsp page that has the following info on it:
(removed the html and jsp tags)




Runtime rt = Runtime.getRuntime();
// forcibly suggest garbage collection
System.gc();

// get the primordial threadgroup
ThreadGroup tg = Thread.currentThread().getThreadGroup();
while (tg.getParent()!=null) { tg=tg.getParent(); }

jtps.getAvailableThreadCount()
jtps.getQueueLength()
jtps.getThreadCount()
rt.totalMemory()
rt.freeMemory()
tg.activeCount()

Why does the value of tg.activeCount() get larger every time this page is called? Better yet, why does the value of tg.activeCount() never get smaller?
 
Marlene Miller
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anthony, I don�t know the answer to your question, but I have a suggestion. ThreadGroup.enumerate will give you a list of the active threads.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic