Robert Hanson wrote: > Jmol users: > > I think we have some reasonable out-of-memory error handling now. In > this business nothing is perfect, but please check out > > http://chemapps.stolaf.edu/jmol/docs/examples-11/new.htm > > and files in > > http://chemapps.stolaf.edu/jmol/docs/examples-11/jmol-11.jar > > Jmol 11.7.16 now tries to handle out-of-memory errors in the following > situations: > > -- any operation involving file loading > -- any command creating an image (write, for example, setting > antialiasing, or creating scalable fonts) > -- in general, any script command involving objects (isosurface, for example) > > If the error occurs with file loading, ZAP will be called, and the > error message will display on the screen > If the error occurs creating an object such as isosurface, all objects > of that type will be deleted in an attempt to recover > If the error occurs while rendering, the rendering just doesn't happen. > > The error message can be retrieved using > jmolGetPropertyAsString("errorMessage") or, if scriptCallback is > enabled, then the script termination message will contain "null" if > there is no error or the error message if there is one. These error > messages include general script errors, but you can look for an out of > memory error because it will always contain > "java.lang.OutOfMemoryError:" as part of the message. > > I can't guarantee this will work all the time, but my preliminary > results at http://chemapps.stolaf.edu/jmol/docs/examples-11/new.htm > suggest that it's pretty good. I'm interested in what others find when > they produce errors using the links on that page or errors of their > own. > The examples work well with Java 1.4.2_18 and Firefox 3.0.4 on Linux.
If I provoke an out-of-memory error by resizing the applet to 6000x6000 pixel (http://www.imb-jena.de/cgi-bin/3d_mapping.pl?CODE=1deh&JMOLVERSION=11.7.16_dev) Jmol traps the error but the message (see below) is only displayed in the java console and for example not in the messageCallback stream. ======= error message =========== viewer handling error condition: java.lang.OutOfMemoryError Error during rendering: java.lang.OutOfMemoryError ================================= I havn't found a resolution yet for the internationalization problem of all kinds of error messages: The messages sent by "messageCallback", "scriptCallback" and 'jmolGetPropertyAsString("errorMessage")' are translated. This makes writing a parser very difficult because it must understand all error messages in all languages. And it must be adapted to each new language added. The additional problem with 'jmolGetPropertyAsString("errorMessage")' is for me to know when to run it and to connect the error message to the right command. Regards, Rolf ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users