Running Garbage Collection [message #233465] |
Wed, 25 April 2007 04:27  |
Eclipse User |
|
|
|
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? Its 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   |
Eclipse User |
|
|
|
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? Its 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   |
Eclipse User |
|
|
|
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 #233618 is a reply to message #233612] |
Fri, 27 April 2007 04:44   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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().
|
|
|
Powered by
FUDForum. Page generated in 0.03108 seconds