Memory leak with openjdk?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Memory leak with openjdk?

Gabriel Landini
When using ImageJ with openjdk 1.6.0_22 (linux 64bit) I see a memory leak (~2
MB each time I run the following script).

for (i=0;i<10;i++){
  makeOval(random()*30, random()*30, 100+random()*30, 100+random()*30);
  wait (10);
  run("Select None");
}

Can somebody else please check if that is the case in any other linux
distribution?

Cheers
Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak with openjdk?

Michael Doube-3
Hi Gabriel,

I don't see a memory leak on Ubuntu 10.10, Sun JDK 1.6.0_26 (64-bit) or
openjdk 1.6.0_22 (64-bit), ImageJ 1.46c.

Memory usage increases, but is garbage collectable.

Michael

On 08/01/12 22:22, Gabriel Landini wrote:
> for (i=0;i<10;i++){
>   makeOval(random()*30, random()*30, 100+random()*30, 100+random()*30);
>   wait (10);
>   run("Select None");
> }
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak with openjdk?

Michael Doube-3
> I don't see a memory leak on Ubuntu 10.10,
Actually 11.04, if it makes a difference.
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak with openjdk?

Gabriel Landini
In reply to this post by Gabriel Landini
On Sunday 08 Jan 2012 22:22:07 you wrote:
> When using ImageJ with openjdk 1.6.0_22 (linux 64bit) I see a memory leak
> (~2 MB each time I run the following script).

Actually it is the System Activity program that shows memory usage going up,
but IJ's memory does not (when clicking on the status bar...)  Am I
misinterpreting what the System Activity reports? The memory usage keeps going
up... and never goes down.

I checked and this happens with Oracle's Java too... (1.6.0_30).
Thanks for any further clues.

Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak with openjdk?

Gabriel Landini
In reply to this post by Michael Doube-3
On Sunday 08 Jan 2012 22:41:52 :Michael Doube wrote:
> Hi Gabriel,
>
> I don't see a memory leak on Ubuntu 10.10, Sun JDK 1.6.0_26 (64-bit) or
> openjdk 1.6.0_22 (64-bit), ImageJ 1.46c.
>
> Memory usage increases, but is garbage collectable.

Hi, thanks Michael.
Hmm I must be misinterpreting what is going on. See my other message I just
sent to the list.
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak with openjdk?

Michael Schmid
In reply to this post by Gabriel Landini
Hi Gabriel,

are you sure it is a memory leak? Java is very reluctant to give back any memory it has ever allocated from the operating system, even if it has a lot of free memory after Garbage Collection.

So if you click on the status line to run gc every time after running the macro, so that Java never claims additional memory from the operating system, do you still see the memory of the JVM increase?
Alternatively, if you run Plugins>Utilties>Monitor Memory, does the memory indicated by the System Activity monitor increase even though 'Monitor meory' of ImageJ shows no increase over the maximum amount used previously?

Michael
________________________________________________________________
On Jan 8, 2012, at 23:48, Gabriel Landini wrote:

> On Sunday 08 Jan 2012 22:22:07 you wrote:
>> When using ImageJ with openjdk 1.6.0_22 (linux 64bit) I see a memory leak
>> (~2 MB each time I run the following script).
>
> Actually it is the System Activity program that shows memory usage going up,
> but IJ's memory does not (when clicking on the status bar...)  Am I
> misinterpreting what the System Activity reports? The memory usage keeps going
> up... and never goes down.
>
> I checked and this happens with Oracle's Java too... (1.6.0_30).
> Thanks for any further clues.
>
> Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak with openjdk?

Gabriel Landini
On Monday 09 Jan 2012 10:23:18 Michael Schmid wrote:
> are you sure it is a memory leak?

No I am not sure. At work it seems to be OK, but I suspect that I have a
different run file than at home. I will check tonight again.

> So if you click on the status line to run gc every time after running the
> macro, so that Java never claims additional memory from the operating
> system, do you still see the memory of the JVM increase?

Yes, at home that was the case. It kept increasing memory usage.

Thanks for the hints.

Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak with openjdk?

Sarah Tomo
Hi Gabriel -

Just curious, did you find any solutions to your memory issues?

I am experiencing (I think) something similar in Windows 7 (64). Memory in task manger reads 10Gigs being used by Image J, while Image J Memory monitor only reads 3 Gigs.

I'm working with stacks of images - which even when closed, still register the memory that was allocated to them when initially opened.

The only solution I've come across is to shut down ImageJ and restart - which is problematic and time consuming.

Suggestions on a work around?

-sarah