Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An applet gets Windows 7 to freeze completely

I've got an applet which does something which gets Windows 7 to freeze completely, the mouse pointer no longer responds, ctrl-alt-del no longer works etc.

When I open the task manager, it doesn't show any significant CPU load or excessive usage of memory.

The freeze sometimes happens when debugging on Eclipse as well, but not always.

I'm not quite sure where I should set breakpoints yet since it's a pretty big GUI application.

Could this be a bug in the JVM? Isn't it supposed to be impossible for an applet to do something like this?

Edit: To answer my own question, I found the bug in Eclipse, and it seems that the call to Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null) gets the whole system to freeze, which is pretty surprising since the Excel file is only 1 MB. Maybe the clipboard isn't really designed for situations like this.

like image 720
user344146 Avatar asked Nov 15 '22 03:11

user344146


1 Answers

Use jStack to generate a Thread Dump. That way you will know what the code is doing. To use it just:

C:\your_java_bin_folder> jstack -l <process-id>

You can get the process id from the Task Manager. jStack is part of the jdk (as far as I know since 1.5).

like image 93
chahuistle Avatar answered Dec 09 '22 11:12

chahuistle