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.

2

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.