views:

124

answers:

3

I have been developing a Java application using J2EE and a Derby database. My boss does most of the testing and I do most of the coding, but he has come to me with a strange problem. He claims that occasionally the Java application "crashes his computer".

To mention a few details, first let me say that I am currently working remotely, so I can't be around when these "crashes" happen. Second, I use OS X 10.6 and he uses Windows XP (SP3 I believe). The Java application in question does not use any JNI or anything weird except for an embedded Derby database. Lastly, he said it freezes everything in Windows (his mouse doesn't even move) -- it doesn't show up in the console like an uncaught exception would.

So, is it possible that my Java program is crashing his computer? I didn't think that Java code could have any system-wide effects outside of the JVM. Is this something that could possibly be the fault of my program, or should I just ignore it and attribute it to some problem with his computer?

+2  A: 

For a Java application to crash the OS it runs on, there must be a bug in the JVM. That said there are situations that can give the same impression:

  • the Java application can grow its heap far enough that the OS starts to swap and other applications appear to slow down to a halt
  • the Java application can grab all CPU by one or more threads in a tight busy loop

If you can setup your testers' machine so that a heap dump can be triggered when the problem occurs, you can analyse that dump remotely. For instance with IBM's Java heap analyzer found on alphaworks.

rsp
Or the operating system could be separately unstable in a way that Java simply pokes extra hard but otherwise is doing completely correct things.
PSpeed
Or the operating system could be completely stable, and @rsp's response is completely accurate.
Alex
I wasn't disagreeing with his options... just adding one. In my personal experience, _every_ time Java has blue-screened a windows box it is because of a bad Windows install or hardware error. I've had Java blue-screen a box with bad RAM, I've had Java blue-screen a box with dodgy network drivers, bad graphics drivers, etc..
PSpeed
And note "his mouse doesn't even move"... is more than just a busy machine. If this happens, also check to see if the keyboard numlock light still toggles with the numlock key. If not then Windows is hard-locked.
PSpeed
+2  A: 

There were cases before of crashes under windows on IBM Thinkpads (and other machines I am sure) due to a bad graphics driver. I'd suggest doing the usual thing of making sure the drivers are up to date just to be on the safe side.

While your code may not use JNI directly a lot of what happens under the hood can (anything that integrates with the underlying OS essentially). Which means drivers can be a big problem.

The other thing would to be sure that the most recent version of the Java is being used (if 1.6_17 isn't possible at last the latest version of the version of Java being used).

One other thing that has fixed random crashes for me is to re-seat the memory (unplug it and plug it back in).

TofuBeer
its funny you mention thinkpads, thats what he's running. i think you may be right that it is a driver issue, but honestly, i'm just interested in knowing if my program could have done this (which sounds like no).
twolfe18
well not directly. The thinkpad issue was ultimately a directx issue where directx was being heavily used by Java where no other application heavily used it in that way, so it exposed an underlying bug in the driver.
TofuBeer
+2  A: 

he said it freezes everything in Windows (his mouse doesn't even move)

A user-mode application — whether Java or otherwise — can't do that against a modern OS like WinNT.

He either has a hardware problem, or a bad driver.

bobince