Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Running Garbage Collection
Running Garbage Collection [message #233465] Wed, 25 April 2007 04:27 Go to next message
Eclipse UserFriend
Originally posted by: sushant.sirsikar.gmail.com

Hello All,
I have created one application using GEF and EMF. As I start using
application, heap size continually goes on increasing .But even if I run
my application and keep it in idle state, eclipse would not run garbage
collection. So if I used my application for long time, it goes out of heap
size. How can I force Eclipse or GEF to do garbage collection after
particular time spam? It’s not logical to put some timer and then ask
eclipse to do garbage collection. It should happen automatically after
particular time spam.

Thanks in advance.

Sushanr Sirsikar
Re: Running Garbage Collection [message #233473 is a reply to message #233465] Wed, 25 April 2007 13:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lamont_gilbert.rigidsoftware.com

On Wed, 25 Apr 2007 04:27:41 +0000, Sushant Sirsikar wrote:

> Hello All,
> I have created one application using GEF and EMF. As I start using
> application, heap size continually goes on increasing .But even if I run
> my application and keep it in idle state, eclipse would not run garbage
> collection. So if I used my application for long time, it goes out of heap
> size. How can I force Eclipse or GEF to do garbage collection after
> particular time spam? It’s not logical to put some timer and then ask
> eclipse to do garbage collection. It should happen automatically after
> particular time spam.
>
> Thanks in advance.
>
> Sushanr Sirsikar

GC is not run based on time. Its run based on a lot of other metrics. If
you want to run one during an idle time, you need to run it yourself. I
actually like to do this.
Re: Running Garbage Collection [message #233537 is a reply to message #233473] Thu, 26 April 2007 04:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sushant.sirsikar.gmail.com

Yes, That's right. So how i should run the garbage collection manually?
Are there any special API in Eclipse or do i need to use Java API? My
application is quite big and user can perform lot of operation. So there
is no common point where i can put code for garbage collection? Actually
my application is Eclipse RCP application and there are almost 30 plug-ins
contributing to the application. That's why i want garbage should be
collected automatically after particular time stamp.
If you go to eclipses Windows->Preferences...->General->and then tick on
'Show Heap Status'. Eclipse will show heap size at the bottom. It has one
button 'Run Garbage Collection'. If you click that button eclipse will do
garbage collection. So i want this garbage collection should happen
automatically. As soon as heap size increases beyond certain limit garbage
collection should happen. Please let me know if anyone is having any ideas
for doing this.

Thanks in advance.

Sushant Sirsikar
Re: Running Garbage Collection [message #233576 is a reply to message #233537] Thu, 26 April 2007 14:59 Go to previous messageGo to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi,

I think you can specify the time interval between consecutive GC runs
through the VM arguments. Isn't that right?

Cheers,
Alex
Re: Running Garbage Collection [message #233583 is a reply to message #233576] Thu, 26 April 2007 16:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sushant.sirsikar.gmail.com

I don't know how to specify this time interval. If anyone knows it please
let me know.
Re: Running Garbage Collection [message #233612 is a reply to message #233583] Fri, 27 April 2007 02:17 Go to previous messageGo to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Doesn't look like time interval can be specified, but perhaps this can
help:
http://java.sun.com/docs/hotspot/gc1.4.2/#2.1.%20Performance %20Considerations|outline
take a look at section 3.1
Re: Running Garbage Collection [message #233618 is a reply to message #233612] Fri, 27 April 2007 04:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sushant.sirsikar.gmail.com

Thanks.Actually i know those VM options. But in my case eclipse is not
refreshing or reducing heap size.It is not doing garbage collection.So is
there any programmatic approach to force eclipse or gef to go for garbage
collection?
Re: Running Garbage Collection [message #233633 is a reply to message #233537] Fri, 27 April 2007 13:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lamont_gilbert.rigidsoftware.com

On Thu, 26 Apr 2007 04:23:22 +0000, Sushant Sirsikar wrote:

> Yes, That's right. So how i should run the garbage collection manually?
> Are there any special API in Eclipse or do i need to use Java API? My
> application is quite big and user can perform lot of operation. So there
> is no common point where i can put code for garbage collection? Actually
> my application is Eclipse RCP application and there are almost 30 plug-ins
> contributing to the application. That's why i want garbage should be
> collected automatically after particular time stamp.
> If you go to eclipses Windows->Preferences...->General->and then tick on
> 'Show Heap Status'. Eclipse will show heap size at the bottom. It has one
> button 'Run Garbage Collection'. If you click that button eclipse will do
> garbage collection. So i want this garbage collection should happen
> automatically. As soon as heap size increases beyond certain limit garbage
> collection should happen. Please let me know if anyone is having any ideas
> for doing this.
>
> Thanks in advance.
>
> Sushant Sirsikar

Of course you can set the GC to collect after a certain Heap size is
reached. Is that what you want to do? Or do you want it to be time based?

Have you read sun's documentation on tuning the GC? Which JVM?
Re: Running Garbage Collection [message #233640 is a reply to message #233618] Fri, 27 April 2007 13:28 Go to previous message
Eclipse UserFriend
Originally posted by: lamont_gilbert.rigidsoftware.com

On Fri, 27 Apr 2007 04:44:33 +0000, Sushant Sirsikar wrote:

> Thanks.Actually i know those VM options. But in my case eclipse is not
> refreshing or reducing heap size.It is not doing garbage collection.So is
> there any programmatic approach to force eclipse or gef to go for garbage
> collection?

NO. GC is a JVM/Java thing, not an Eclipse thing. If you want the GC to
run, you need to tune the GC, or run it yourself. System.gc().
Previous Topic:Resizing labels
Next Topic:DirectEditManger and UpdateManager
Goto Forum:
  


Current Time: Sun Dec 04 13:04:37 GMT 2022

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

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

Back to the top