Eric,

>
> I am spending hours/days doing tests on the "total" (used) memory
> reported in the Jmol applet menu. For every step, I have to manually
> open the Jmol menu and hand record the "total memory" and "free memory"
> values.
>
> Although there is supposed to be a read-only "_memory", "show
> _memory" returns <not set> in 11.4.RC1.
>
> It would be great if there were a show _memory command that returned
> all 3 values (in one line) that are displayed in the Jmol menu. Then
> I could accumulate them in a string variable, format them into a
> report, and run these tests many-fold faster.
>

That's a bug. From the console or a script you can use

 print _memory

Or, from JavaScript, use

var memUse = jmolEvaluate("_memory")

to get two of the three numbers you are looking for. These include the
Java measures:

 Runtime.getRuntime().totalMemory()
 Runtime.getRuntime().freeMemory()

But, as discussed in previous threads, these are only marginally useful,
because Java accesses memory dynamically. Just because Java reports a
certain amount of memory as "free" does not mean that is all that is
available, because in the next instance Java may request more, and both
these numbers may jump to higher values.

Java does not provide a reliable mechanism to find out exactly how much
memory is really available to an applet. The third number you are seeing
is only available on some systems, so it is not a reliable measure. It is

Runtime.getRuntime().maxMemory()

This in principle gives you some measure of the maximum, and do experiment
with it, but don't depend upon it being there for all users.

> The purpose of the tests is to try to deduce what it is about my Jmol
> Tutorial-Authoring Template's JTAT Demo Tutorial that gradually
> consumes all java memory in certain browsers and platforms. And if I
> can narrow it down, then can I find a trick to free up that memory?
> such as a "zap" at a critical time?
>

I'm presuming you are using the latest Jmol version, right? A major
long-standing memory leak was fixed in Jmol 11.3.61. I am not aware of any
additional memory leaks, but I'm always open to checking for them again if
you can give me a good test example.

As I recall, some browsers (Opera?) do not necessarily dispense with
applets when the page is closed or reloaded. Jmol might be able to do a
better job than the browsers do by unloading viewers found to be inactive
because their documents are no longer available. So that is definitely
something we could look into.

I'm glad you are working on this, Eric. It's possible you will find
something that we can work with to give better advice to web developers.
Let me know if you need any help.

Bob


> Thanks, -Eric
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to