jvm crash

S

suru

Hi,
I am facing (jvm) crash for applet.
Eventhough its not consistent, but its still quite frequent.
From the logs, not clear the reason/behaviour.

Any body knows, how can i gather more information about the jvm crash?
does java writes any info before crashing?

thnx,
suraj hajare
 
A

Andreas Leitgeb

suru said:
btw my jre version is 1.6.0_13

which OS (Windows, Mac , Linux, Unix, ...?) ?

There may exist a file named like "hs_err_*.log",
that may contain more useful information.

Use your OS's file finder dialog and search for files
that start with "hs_err"
 
S

suru

my os is Windows Vista (Service Pack1)

i m currently looking for "hs_err_*.log" files,
btw where exactly shall we expect these files to reside?
 
L

Lew

suru said:
my os [sic] is Windows Vista (Service Pack1)

i [sic] m [sic] currently looking for "hs_err_*.log" files,
btw where exactly shall we expect these files to reside?

If you follow the advice Andreas gave you,
Use your OS's file finder dialog and search for files
that start with "hs_err"

you will find out quickly.
 
A

Andreas Leitgeb

suru said:
my os is Windows Vista (Service Pack1)
i m currently looking for "hs_err_*.log" files,
btw where exactly shall we expect these files to reside?

I don't really know where Java puts them on Windows.
(on linux it's in the user's home directory)

If there is no file of the given pattern on any of your
local disks, then I can't help, either - Sorry.
 
S

suru

i had a crash day before yest. on my machine,

today i searched, entire "c:\"
but still no "hr_*" file found in entire c drive,

currently trying to crash app once again,
may be window has deleted old crash logs,

btw windoes XP preserves the old crash files,
dont know about Vista.
 
A

Andreas Leitgeb

suru said:
i had a crash day before yest. on my machine,
today i searched, entire "c:\"
but still no "hr_*" file found in entire c drive,

I didn't write "hr_*" !
 
R

Roedy Green

I am facing (jvm) crash for applet.
Eventhough its not consistent, but its still quite frequent.
From the logs, not clear the reason/behaviour.

There is a distinction between the app crashing and the JVM crashing.
JVM crashes are much more rare.

Enable the console, and tell us what you see.

see http://mindprod.com/jgloss/console.html
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Deer hunting would be fine sport, if only the deer had guns."
~ William S. Gilbert of Gilbert and Sullivan
 
S

suru

There is a distinction between the app crashing and the JVM crashing.
JVM crashes are much more rare.  

Enable the console, and tell us what you see.

seehttp://mindprod.com/jgloss/console.html
--
Roedy Green Canadian Mind Productshttp://mindprod.com

"Deer hunting would be fine sport, if only the deer had guns."
~ William S. Gilbert of Gilbert and Sullivan


my observation is that,
suddenly, my applet (& its child windows)are gone,
and i find jvm crash log file, explaining the details.

evernthough i have log file, can u explain difference between "app
crashing and the JVM crashing"
?
 
J

John B. Matthews

suru said:
my observation is that, suddenly, my applet (& its child windows)are
gone, and i find jvm crash log file, explaining the details.

Can you supply an example that demonstrates your problem? Here is an
example of an applet crashing the Event Dispatching Thread:

<code>
//<applet code="Hello.class" width=400 height=200></applet>
import java.applet.*;
import java.awt.*;
import javax.swing.*;

public class Hello extends JApplet {
private static final Font font = new Font("Serif", Font.BOLD, 24);
private static final String s = "Hello World!";
public void init() {
System.out.println("Initializing...");
}
public void paint(Graphics g) {
g.setFont(font);
int xx = this.getWidth();
int yy = this.getHeight();
int w2 = g.getFontMetrics().stringWidth(s) / 2;
int h2 = g.getFontMetrics().getDescent();
g.setColor(Color.lightGray);
g.fillRect(0, 0, xx, yy);
g.setColor(Color.black);
g.drawString(s, xx / 2 - w2, yy / 2 + h2);
int evil = 1/0; // line 22
}
public void destroy() {
System.out.println("That's all, folks...");
}
}
</code>

<console>
Java Plug-in 1.5.0
Using JRE version 1.5.0_19 Java HotSpot(TM) Client VM
User home directory = /Users/...
Initializing...
Exception in thread "AWT-EventQueue-2"
java.lang.ArithmeticException: / by zero
at Hello.paint(Hello.java:22)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:276)
....
</console>

Here's is the same error in the debugger:

$ appletviewer -debug Hello.java
Initializing jdb ...
run sun.applet.Main Hello.java
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.ThrowableVM Started: Warning: Temporarily overwriting system property at user's
request: key: http.proxyPort old value: 8118 new value: 8118
Warning: Temporarily overwriting system property at user's request: key:
http.proxyHost old value: 127.0.0.1 new value: 127.0.0.1
Initializing...
Exception in thread "AWT-EventQueue-1" java.lang.ArithmeticException: /
by zero
at Hello.paint(Hello.java:22)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:276)
....
evernthough i have log file, can u explain difference between app
crashing and the JVM crashing"?

<http://java.sun.com/j2se/1.5/pdf/jdk50_ts_guide.pdf>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top