0

Possible Duplicate:
Get a List of all Threads currently running in Java

This is just for testing purposes - not production UI

Is it possible to set something like a button on my Application's base dialog that when clicks would System Print the current running threads?

Something like below

   Button showThreadsButton = new Button(composite, SWT.PUSH);
   pdfButton.setText("Show Running Threads");
   pdfButton.addSelectionListener(new SelectionAdapter() {
       public void widgetSelected(SelectionEvent e) {
          String test = Display.getThreads().toString();
          System.out.println("Running Threads " + test + "\n);
       }
   });

I am not sure if all my threads are disposing like they should be.

Community
  • 1
  • 1
jkteater
  • 1,381
  • 3
  • 36
  • 69

1 Answers1

0

You can use jstack from the command line to dump threads. Then you don't need to worry about it leaking into your production code.

jstack is part of the jvm.

Jamie
  • 1,888
  • 1
  • 18
  • 21