Hello,

One alternative to MemoryMXBean and MemoryUsage is

Runtime.getRuntime().totalMemory() - total memory occupied by JVM in bytes

Runtime.getRuntime().freeMemory() - the free memory from total memory,
a call to System.gc() would increase a little bit this memory

So total used memory would be Runtime.getRuntime().totalMemory() -
Runtime.getRuntime().freeMemory()

Runtime.getRuntime().maxMemory() - the max memory JVM will occupy (JVM
can extend it's memory)


Eclipse has a memory monitoring mechanism. It can be activated through
the Preference Page -> General Tab -> Show Heap Status

They use (in org.eclipse.ui.internal.HeapStatus) Runtime.getRuntime().*

Then a sleeping thread checks periodically the memory status.

Bogdan

On 3/29/07, Bob Tarling <[EMAIL PROTECTED]> wrote:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/MemoryMXBean.html

I was wondering if we could have a meter displayed in the status bar
that was updated in a low priority thread. The user could then see as
soon as they start getting low.

There is a problem during save I think because the zip process tends
to eat a lot of memory.

Bob.


On 29/03/07, Linus Tolke <[EMAIL PROTECTED]> wrote:
> Is there a method in java to get a notification in advance when the free
> memory is getting low? In that case we could implement a pop-up window
> with a friendly warning so that the user can save, stop, reconfigure and
> restart.
>
>         /Linus
>
> *******************************************************************
> Linus Tolke
> [EMAIL PROTECTED]
> *******************************************************************
>
>
>
>
> ________________________________
>
> Från: Bob Tarling [mailto:[EMAIL PROTECTED]
> Skickat: to 2007-03-29 16:11
> Till: [email protected]
> Ämne: Re: [argouml-users] Out of memory and lose work
>
>
>
> See the FAQ from the ArgoUML homepage on how to increase your heap
> space when running ArgoUML
>
> Bob.
>
> On 29/03/07, Chu Jeang Tan <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I was using ArgoUML the first time and manually creating a diagram
> > with about 10-12 classes with many associations. It was working fine
> > until I'm trying to save it. The app becomes unresponsive, and the
> > console shows Java out of memory error, and then I had to terminate
> > the process.
> >
> > Because of this, the work is lost, and I can't open the partially
> > written zargo files. Luckily, my previous saved file is still
> > available as xyz.zargo~.
> >
> > Anyway, I think this behavior is somewhat undesirable as users of the
> > software is prone to lose data as the memory usage shoots up when you
> > are trying to save the model.
> >
> > I'm using argouml 0.24, sun jdk 1.5.0_11 on XP Pro. I also find that
> > abstract classes are italicized but abstract operations are not
> > italicized.
> >
> > Thanks
> > Chu
> > --
> > Chu Jeang Tan
> > [EMAIL PROTECTED]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to