{{theTime}}

Search This Blog

Total Pageviews

How to find number of threads running in JVM?

Try this:


 ThreadGroup tgroup = Thread.currentThread().getThreadGroup();
 while(tgroup.getParent() != null) {
 tgroup = tgroup.getParent();
 }
 Thread[] t = new Thread[tgroup.activeCount()];
 tgroup.enumerate(t);

No comments:

Generate Insert Sql from Select Statement

SELECT 'INSERT INTO ReferenceTable (ID, Name) VALUES (' +        CAST(ID AS NVARCHAR) + ', ''' + Name + ''...