Hi developers,

the increasing power of Jmol is fantastic. But if this power is used
within the applet it greatly enhances the danger of freezing Jmol by an
"out of memory error".

When I started to build the JenaLib Jmol Viewer interface (now Jena3D)
about 3 years ago there was only one really critical risk of getting an
"out of memory" error: during file loading.

But now there are plenty of other critical commands, e.g.:

1) set antialiasDisplay on
2) set fontScaling on
3) image export, e.g. 'jmolGetPropertyAsString("image")'
4) save STATE

In order to avoid that users will stop working with the Jena3D interface
because it often just stops working (caused by an "out of memory" error
not visible for most of the users), I am currently trying to develop a
system that detects freezing of Jmol. Then the user will at least get a
message about the problem and how it might be avoided in the future.

The general idea is the following:

1) Javascript interface side
Each time a critical script command set is started, a timeout is set.
After the timeout a subroutine checks if the command was completed.
The check is repeated regularly until a defined time limit is reached.
In this case the interface displays a message that Jmol might be freezed
 and what could be done to avoid it.

2) Jmol side
At the end of each critical command set, the last command sets a
javascript variable or starts a javascript function that indicates success.

The basic approach works already, but there is (at least) one problem
remaining:

How can the interface distinguish between a script error and freezing?

If there occurs a script error within the critical command set, Jmol
will stop processing and will not reach the last command. And then the
interface will finally tell the user that Jmol is frozen.

The interface could try to analyze the message callback stream to detect
script errors. But since the complexity of the messages was increased
during the last years it will be rather insecure and will also slow down
the interface.

So I would like to propose to implement a kind of error trapping system.
A possible approach would be that Jmol would look for a specific
function when a script error would occur. If this function would be
defined it would run the commands within this function.

Q: What do you think about this idea?

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-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to