The external thread dumps are the best option if you want to investigate performance degradation of Java applications. Almost all geeks out there who are dealing with Thread Dumps are familiar with awesome tools called TDA. However, once in a while when you are generating your thread dumps for applications with Java 8, you will encounter to following error in console:

Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "5 os_prio=0"
  at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
  at java.lang.Long.parseLong(Long.java:589)
  at java.lang.Long.<init>(Long.java:965)
  at com.pironet.tda.utils.ThreadsTableModel.getValueAt(ThreadsTableModel.java:80)
  at com.pironet.tda.utils.TableSorter.getValueAt(TableSorter.java:285)
 ....

TDA team investigated this issue and they belive it’s related to fact that an os_prio culmn exist between prio and tid and they fixed it here. However, if you are not willing to apply the fix or changing your TDA version, you can clean up your Thread dumps with following regex:

For Linux:

sed -i 's/prio=[0-9]\{1,2\} os_prio=-\?[0-9]\{1,2\}/prio=5/g' <filename>

For Mac:

sed -i '' -E 's/prio=[0-9]{1,2} os_prio=-?[0-9]{1,2}/prio=5/g' <filename>

Credit of above solution goes to Atlassian Team (here).

TDA is available in GitHub


Saleh Parsa

This blog contains my brain's dump!