Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Memory leak?
Memory leak? [message #148888] Thu, 23 October 2003 21:43 Go to next message
Eclipse UserFriend
Originally posted by: myles_jeffery.hotmail.com

Hi,

I noticed using Windows Task Manager that the memory usage of Eclipse would
continually go up after opening and then closing editors. I presumed there
was a bug with Eclipse or with my custom editor code. On checking with
OptimiseIt it seems that there is no memory leak: all my objects are freed
and in fact Optimizeit reports memory consumption goes back to what it was
after I close the editor: yet in Task Manager it still goes up.

Can anyone explain this?

Thanks,

Myles
Re: Memory leak? [message #148975 is a reply to message #148888] Fri, 24 October 2003 03:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Myles Jeffery wrote:

>Hi,
>
>I noticed using Windows Task Manager that the memory usage of Eclipse would
>continually go up after opening and then closing editors. I presumed there
>was a bug with Eclipse or with my custom editor code. On checking with
>OptimiseIt it seems that there is no memory leak: all my objects are freed
>and in fact Optimizeit reports memory consumption goes back to what it was
>after I close the editor: yet in Task Manager it still goes up.
>
>
>Can anyone explain this?
>
>
It's up to the VM when and if they release memory back to the OS and the
Task manager isn't very trustworthy.

Dani

>Thanks,
>
>Myles
>
>
>
>
Re: Memory leak? [message #149013 is a reply to message #148975] Fri, 24 October 2003 08:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: myles_jeffery.hotmail.com

I downloaded the latest release of JDK1.4.1 as the version I had, 1.4.1_03,
had a bad memory leak associated with the StringBuffer class. I don't know
if this was related to my problem but I would certainly recommend everyone
to upgrade if they haven't already.

I agree with your assertion that task manager is not a reliable method for
memory monitoring. The amount of memory the JVM claims it is using and the
amount displayed in task manager never seems to tie up.

"Daniel Megert" <daniel.megert@gmx.net> wrote in message
news:bnalrf$1cg$1@eclipse.org...
> Myles Jeffery wrote:
>
> >Hi,
> >
> >I noticed using Windows Task Manager that the memory usage of Eclipse
would
> >continually go up after opening and then closing editors. I presumed
there
> >was a bug with Eclipse or with my custom editor code. On checking with
> >OptimiseIt it seems that there is no memory leak: all my objects are
freed
> >and in fact Optimizeit reports memory consumption goes back to what it
was
> >after I close the editor: yet in Task Manager it still goes up.
> >
> >
> >Can anyone explain this?
> >
> >
> It's up to the VM when and if they release memory back to the OS and the
> Task manager isn't very trustworthy.
>
> Dani
>
> >Thanks,
> >
> >Myles
> >
> >
> >
> >
>
Re: Memory leak? [message #149072 is a reply to message #149013] Fri, 24 October 2003 09:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vkyr.nospam-ision.net

"Myles Jeffery" <myles_jeffery@hotmail.com> schrieb im Newsbeitrag
news:bnb7a0$icn$1@eclipse.org...
> I downloaded the latest release of JDK1.4.1 as the version I had,
1.4.1_03,
> had a bad memory leak associated with the StringBuffer class. I don't know
> if this was related to my problem but I would certainly recommend everyone
> to upgrade if they haven't already.

There is already even a Sun JDK 1.4.2_01 available!


> I agree with your assertion that task manager is not a reliable method for
> memory monitoring. The amount of memory the JVM claims it is using and the
> amount displayed in task manager never seems to tie up.
>

The Windows Task Manager has a much different OS process oriented view of
memory here, where in contrast tools like OptimizeIt etc. show you a much
more detailed and fine grained VM heap memory oriented view.

In order to continously/permanently monitor Eclipse's underlayed VM heap
memory you can also try out for example this Eclipse SWT based MM:

http://eclipsewiki.swiki.net/.uploads/plugins/de.kyrsoft.mem monitor_1.0.2_sw
t.zip (older for Eclipse 2.x)

http://eclipsewiki.swiki.net/.uploads/plugins/swt_memmonitor 11.zip (for
Eclipse 3.x)


-vkyr
Re: Memory leak? [message #149080 is a reply to message #149072] Fri, 24 October 2003 09:42 Go to previous messageGo to next message
Eclipse UserFriend
On Fri, 24 Oct 2003 15:35:39 +0200, Valentino Kyriakides
<vkyr@nospam-ision.net> wrote:

> There is already even a Sun JDK 1.4.2_01 available!

1.4.2_02 now ;-)

--
Steve
Re: Memory leak? [message #149349 is a reply to message #149013] Sun, 26 October 2003 21:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.Rigidsoftware.com

On Fri, 24 Oct 2003 13:50:54 +0100, Myles Jeffery wrote:

> I downloaded the latest release of JDK1.4.1 as the version I had,
> 1.4.1_03, had a bad memory leak associated with the StringBuffer class.
> I don't know if this was related to my problem but I would certainly
> recommend everyone to upgrade if they haven't already.
>
> I agree with your assertion that task manager is not a reliable method
> for memory monitoring. The amount of memory the JVM claims it is using
> and the amount displayed in task manager never seems to tie up.
>
>
I do not agree. in windows NT based OSes task manager is accurate AFAIK.
The JVM is an application unto itself. You application only lives within
the JVM. Windows is reflecting the memory the JVM is using. If you
change your garbage collection strategy you will see this number fluctuate
more. But even then taskmanager wont show it.

When the JVM frees memory (objects), your applicaiton will see this new
memory available. But task manager will only see more or less memory when
the JVM frees memory back to windows. This is different from freeing
memory to your application. The JVM will likely rarely be asked to free
any of its memory by windows unless you are doing some other windows
process.

if you minimize your application and let it idle for a while, then use
some other app, its likely you will eventually see your JVM release memory
back to windows.


CL
Re: Memory leak? [message #149399 is a reply to message #149349] Mon, 27 October 2003 03:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Eric.Jain.isb-sib.ch

> if you minimize your application and let it idle for a while, then use
> some other app, its likely you will eventually see your JVM release
> memory back to windows.

What I actually see is that Windows starts swapping out most of the 100-150
MB Eclipse is using - regardless of how much free memory is available :-(

In any case, it seems that Runtime.getRuntime().totalMemory() only returns
the size of the object heap, i.e. not including memory used for classes,
threads, native code etc. This may account for quite a few megabytes.

--
Eric Jain
Re: Memory leak? [message #149641 is a reply to message #149349] Mon, 27 October 2003 04:59 Go to previous message
Eclipse UserFriend
Originally posted by: vkyr.nospam-ision.net

"CL [dnoyeB] Gilbert" <Lamont_Gilbert@Rigidsoftware.com> schrieb im
Newsbeitrag news:pan.2003.10.27.02.02.36.103207@Rigidsoftware.com...
> On Fri, 24 Oct 2003 13:50:54 +0100, Myles Jeffery wrote:
>
> ...
> When the JVM frees memory (objects), your applicaiton will see this new
> memory available. But task manager will only see more or less memory when
> the JVM frees memory back to windows. This is different from freeing
> memory to your application. The JVM will likely rarely be asked to free
> any of its memory by windows unless you are doing some other windows
> process.

During your use of Eclipse the memory of it's underlayed JVM has an initial
size which can grow on demand until a settable max value. However, the
memory the JVM occupies will not be released in a way that the operating
system gets the memory back. Instead the released memory (via GC) of the JVM
will be still available or reserved for future other objects. You will
really have to quit the running JVM in order to get any of it's occupied
memory back to the underlaying OS.

You can see (as an analogy) the JVM as a glass which wrapper might grow on
demand, but doesn't shrink. Only the contents in the glass (the liquor, in
our case the occupied heap memory for objects etc. which run in the
JVM/glass) can grow and shrink. And in order to shrink the wrapper of the
glass you have to destroy/smash it.

> if you minimize your application and let it idle for a while, then use
> some other app, its likely you will eventually see your JVM release memory
> back to windows.

That's a sort of windows like process memory swapping, if you maximize the
app again after a minimized state, you will see that it again demands the
huge memory as before.

-vkyr
Previous Topic:[Eclipse 2.1.1] No icons in menu bar
Next Topic:creating new methods/fields
Goto Forum:
  


Current Time: Thu Jul 17 20:53:33 EDT 2025

Powered by FUDForum. Page generated in 0.78466 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top