• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

J2ME App Crashes with Error: "An unexpected error has been detected by HotSpot Virtual Machine"

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I am a Java Mobile Application Developer from India. I am developing an application, which integrates GPS and Mobile Mapping solution in it. I am targeting Motorola iDEN devices. Within Mapping module, the app downloads image tiles from Google Static Maps in the background as the user traverses on the map. I am maintaining a Vector of last 10 downloaded image tiles which are painted on screen as user scrolls on the map. I am using Motorola i605 simulator for testing.

The problem that I am facing is, when I traverse on the Map rigorously, the application crashes and Simulator gets turned off. On the Console, I get the following message:

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000, pid=1616, tid=4004
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_09-b03 mixed mode, sharing)
# Problematic frame:
# C 0x00000000
#
# An error report file with more information is saved as hs_err_pid1616.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#


The error does not occur frequently..still, once in around 200 tiles. Moreover, rest of the application performs good.
I am completely clueless about the error, its reason and how to handle/avoid it. Please help!

 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This kind of error is ALWAYS due to a bug in the JVM. Java never terminates this way when it's a user/programmer problem. Only when the JVM itself is defective.

The only solutions are to either code your way around the situation that crashes the JVM or to use an alternate JVM.

Normally, code-arounds are a bad solution. Anything subtle enough to have gotten past the JVM implementor's tests is probably not going to be simple to understand how to avoid. And whatever kludges you used would almost certainly pollute the app for a long time after the bad JVM was history.

In mobile devices, however, the JVM is more likely be more or less permanently welded into the device, which makes the second solution more difficult, if not impossible.
 
SwatiJdev Sisodia
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Tim, for the reply.

As you said, it was JVM error, I ran my application on two machines with JDK1.5 Update 9 and JDK1.5 Update 17. To my amaze, there was a remarkable difference.!
Well, I have made little change in my code, i.e., I am ignoring user clicks on the Map more frequently than a second. As I supposed, every user click caused heavy calculations (log, exp. etc.) and image tile download from Google server. So, slowing down this process helped and I am not getting this problem on Simulator. But I'm yet to test it on real device. Hoping this should work there too.

Thanks again.
Cheers,
Swati.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic