garbage collection

for me the greatest annoyance with IDEA is the garbage collection pauses. I've searched the forum archives and have seen previous discussions on the topic. Still, i hate it when GC kicks in always at the worst possible time, while I'm in a middle of finishing a thought, or trying to show something to my boss, etc. There are plenty of times when IDEA sits idle while I use other apps or away from the computer. Why can't these idle periods be used to run the GC? There must a good reason and I'm curious to know what it is.

17 comments
Comment actions Permalink

Garbage collection is a matter that should be managed by the JVM, and the app should not do assumptions about when is best to start it. I normally tweak the startup parameters of all my java apps in order for them to be started using the concurrent collector in the old generation: this normally stops the long full GCs that happen sometimes. I can't post it now because I'm not on my regular pc, but if you look in the past you should find my settings, I remember posting them in the past.

0
Comment actions Permalink

Dmitry Beransky wrote:

for me the greatest annoyance with IDEA is the garbage collection pauses. I've searched the forum archives and have seen previous discussions on the topic. Still, i hate it when GC kicks in always at the worst possible time, while I'm in a middle of finishing a thought, or trying to show something to my boss, etc. There are plenty of times when IDEA sits idle while I use other apps or away from the computer. Why can't these idle periods be used to run the GC? There must a good reason and I'm curious to know what it is.


Garbage collection should be a responsibility of the runtime environment
(ie, JRE), not IDEA. Sometimes the runtime is not smart enough and
collects garbage in the worst time possible (ie, when it needs memory,
when you're working). Tuning the VM parameters should help a lot with
garbage collection -- search the newsgroups or check the sun JDK
documentation for tips and suggestions about hom to tune garbage
collection.

--
Marcus Brito <pazu@animegaiden.com.br>


0
Comment actions Permalink

"Marcus Brito" <pazu@animegaiden.com.br> wrote in message
news:c7nrcc$pl6$1@is.intellij.net...

...
Garbage collection should be a responsibility of the runtime environment
(ie, JRE), not IDEA. .... Tuning the VM parameters should help a lot with
garbage collection -- search the newsgroups or check the sun JDK
documentation for tips and suggestions about hom to tune garbage
collection.

>

--
Marcus Brito <pazu@animegaiden.com.br>

>
>

Yes, but...

Tuning garbage collection should be the responsibility of the (IDEA)
application developer (ie. JetBrains) not the user of the application.

The gc options used by the launcher should be tuned to provide the best user
experience out of the box.

I know that when I deliver an application to my user community, I don't
expect them to adjust the garbage collection settings. At least not without
clear guidance from me on what settings are likely to provide the best user
experience for a given hardware configuration.

Tim



0
Comment actions Permalink

Yes, but this has never been an issue for me or any other user of IDEA whom I've seen working, so it's only bad out of the box for a minority.

0
Comment actions Permalink

Yes, in general that's true, but there are some things about app design that are still important.

For instance, if an app has background threads that run all the time, at a higher priority than the garbage collector, then the app will prevent the garbage collector from running unless the memory situation gets desperate. If the background threads pause periodically, on the other hand, then the garbage collector can kick in and do its job if it sees the opportunity.

Also, the "garbage collection should be managed by the JVM" approach is better for some kinds of applications than others. It results in better overall throughput (e.g. of server apps), but not necessarily better user experience in UI-oriented apps. I wouldn't mind if Idea did an automatic garbage collection every time it noticed that it hadn't received a UI event (mouse click or button press) for ten minutes, for instance.

I currently run Idea with the concurrent garbage collector. However, I notice that it makes touch-typing difficult, because the tiny pauses make the typing experience rather "jittery". Add the Subversion plugin to this (which creates performance problems of its own, at least in the current version), and you get an IDE that doesn't pause for garbage collection, but is noticeably slow at doing everything. I find this better than long GC pauses, but not much better. It's still a long shot away from a C++ IDE that has essentially instant response.

0
Comment actions Permalink

It's been a significant problem for every user of Idea that I've seen (of which there have been twenty or so). Once you work on a really big product, the garbage collection pauses get more frequent, and longer. If you're on a memory-constrained machine, it's even worse, because garbage collection can trigger swapping.

0
Comment actions Permalink

Just to say I've noticed this problem being much worse with version 4 than
it ever was for version 3. I have a gig of memory and have played with both
the intial and maximum heap sizes that IDEA runs with. None of this appears
to help and I still get long (eg sometimes 10 to 20 seconds) pauses
regularly. Our project isn't what I would call huge either (certainly not
"enterprise" level).

I think the general "bloat" (in terms of memory use and overall speed) that
has come about with version 4 is very bad for the software. Speed,
efficiency and low memory use were the primary reasons we chose IDEA over
Eclipse. Let's hope that regardless of whose "fault" the pauses are
(JRE/IDEA/setup/etc) that something can be done about it soon - I'm on the
verge of downgrading back to version 3 (and in fact have already done so on
my laptop) :(

Cheers,

TicH


"Derek Foster" <no_mail@jetbrains.com> wrote in message
news:24604146.1084660398268.JavaMail.itn@is.intellij.net...

It's been a significant problem for every user of Idea that I've seen (of

which there have been twenty or so). Once you work on a really big product,
the garbage collection pauses get more frequent, and longer. If you're on a
memory-constrained machine, it's even worse, because garbage collection can
trigger swapping.


0
Comment actions Permalink

Me thinks you need to upgrade your hardware before downgrading your
software. I run it on my ThinkPad laptop and it rocks with stock
settings.

Maybe you can tweak your OS?

Norris Shelton
Sun Certified Java Programmer




Richard Kent wrote:

>Just to say I've noticed this problem being much worse with version 4 than
>it ever was for version 3. I have a gig of memory and have played with both
>the intial and maximum heap sizes that IDEA runs with. None of this appears
>to help and I still get long (eg sometimes 10 to 20 seconds) pauses
>regularly. Our project isn't what I would call huge either (certainly not
>"enterprise" level).
>
>I think the general "bloat" (in terms of memory use and overall speed) that
>has come about with version 4 is very bad for the software. Speed,
>efficiency and low memory use were the primary reasons we chose IDEA over
>Eclipse. Let's hope that regardless of whose "fault" the pauses are
>(JRE/IDEA/setup/etc) that something can be done about it soon - I'm on the
>verge of downgrading back to version 3 (and in fact have already done so on
>my laptop) :(
>
>Cheers,
>
>TicH
>
>
>"Derek Foster" <no_mail@jetbrains.com> wrote in message
>news:24604146.1084660398268.JavaMail.itn@is.intellij.net...

>
>>It's been a significant problem for every user of Idea that I've seen (of
>>
>>
>which there have been twenty or so). Once you work on a really big product,
>the garbage collection pauses get more frequent, and longer. If you're on a
>memory-constrained machine, it's even worse, because garbage collection can
>trigger swapping.
>
>

>

0
Comment actions Permalink

fwiw, I agree that if you have control over the purchase of hardware, upgrading can make a world of difference. I have no performance problems either at work or on my personal HP laptop. Of course both are P4 and have 1gig of memory. The desktop is a 3GHz and the laptop is a 2.33GHz. And I have developed a habit of clicking on the GC icon whenever the memory usage looks like it is creeping up. Especially I am about to do something that may be likely to push it even higher.

Before I was lucky enough to upgrade both systems I had the same complaint for IDEA 3.0 and Aurora.

Unfortunately, we can't always control the hardware that we are using. Our bosses do that.

I'm sure that I will have the same complaint in a year or two when the requirements for IDEA 5/6 increase and my hardware does not.

With that in mind, it would be extremely nice if someone at JetBrains was responsible for doing some performance testing and experimentation on low-end systems. Recommendations should be available for tweeking the runtime environment and IDEA configuration settings based on different generic hardware and OS configurations.

Tim

"Norris Shelton" <i.hate.spam@yahoo.com> wrote in message news:40A8FAEC.8080001@yahoo.com...
Me thinks you need to upgrade your hardware before downgrading your software. I run it on my ThinkPad laptop and it rocks with stock settings.

Maybe you can tweak your OS?

Norris Shelton
Sun Certified Java Programmer



Richard Kent wrote:
Just to say I've noticed this problem being much worse with version 4 than
it ever was for version 3. I have a gig of memory and have played with both
the intial and maximum heap sizes that IDEA runs with. None of this appears
to help and I still get long (eg sometimes 10 to 20 seconds) pauses
regularly. Our project isn't what I would call huge either (certainly not
"enterprise" level).

I think the general "bloat" (in terms of memory use and overall speed) that
has come about with version 4 is very bad for the software. Speed,
efficiency and low memory use were the primary reasons we chose IDEA over
Eclipse. Let's hope that regardless of whose "fault" the pauses are
(JRE/IDEA/setup/etc) that something can be done about it soon - I'm on the
verge of downgrading back to version 3 (and in fact have already done so on
my laptop) :(

Cheers,

TicH


"Derek Foster" <no_mail@jetbrains.com> wrote in message
news:24604146.1084660398268.JavaMail.itn@is.intellij.net...
It's been a significant problem for every user of Idea that I've seen (of
which there have been twenty or so). Once you work on a really big product,
the garbage collection pauses get more frequent, and longer. If you're on a
memory-constrained machine, it's even worse, because garbage collection can
trigger swapping.


0
Comment actions Permalink

ROFL. That's funny. Think anybody at M$ is going to be doing that for
.crap?

Norris Shelton
Sun Certified Java Programmer




Tim Haley wrote:

fwiw, I agree that if you have control over the purchase of hardware,
upgrading can make a world of difference. I have no performance
problems either at work or on my personal HP laptop. Of course both
are P4 and have 1gig of memory. The desktop is a 3GHz and the laptop
is a 2.33GHz. And I have developed a habit of clicking on the GC icon
whenever the memory usage looks like it is creeping up. Especially I
am about to do something that may be likely to push it even higher.

>

Before I was lucky enough to upgrade both systems I had the same
complaint for IDEA 3.0 and Aurora.

>

Unfortunately, we can't always control the hardware that we are
using. Our bosses do that.

>

I'm sure that I will have the same complaint in a year or two when the
requirements for IDEA 5/6 increase and my hardware does not.

>

With that in mind, it would be extremely nice if someone at JetBrains
was responsible for doing some performance testing and experimentation
on low-end systems. Recommendations should be available for tweeking
the runtime environment and IDEA configuration settings based on
different generic hardware and OS configurations.

>

Tim

>

"Norris Shelton" <i.hate.spam@yahoo.com
<mailto:i.hate.spam@yahoo.com>> wrote in message
news:40A8FAEC.8080001@yahoo.com...
Me thinks you need to upgrade your hardware before downgrading
your software. I run it on my ThinkPad laptop and it rocks with
stock settings.

>

Maybe you can tweak your OS?

>
>Norris Shelton
>Sun Certified Java Programmer
>

>
>
>

Richard Kent wrote:

>
>>Just to say I've noticed this problem being much worse with version 4 than
>>it ever was for version 3. I have a gig of memory and have played with both
>>the intial and maximum heap sizes that IDEA runs with. None of this appears
>>to help and I still get long (eg sometimes 10 to 20 seconds) pauses
>>regularly. Our project isn't what I would call huge either (certainly not
>>"enterprise" level).
>>
>>I think the general "bloat" (in terms of memory use and overall speed) that
>>has come about with version 4 is very bad for the software. Speed,
>>efficiency and low memory use were the primary reasons we chose IDEA over
>>Eclipse. Let's hope that regardless of whose "fault" the pauses are
>>(JRE/IDEA/setup/etc) that something can be done about it soon - I'm on the
>>verge of downgrading back to version 3 (and in fact have already done so on
>>my laptop) :(
>>
>>Cheers,
>>
>>TicH
>>
>>
>>"Derek Foster" <no_mail@jetbrains.com> wrote in message
>>news:24604146.1084660398268.JavaMail.itn@is.intellij.net...
>>
>>
>>>It's been a significant problem for every user of Idea that I've seen (of
>>>
>>>
>>which there have been twenty or so). Once you work on a really big product,
>>the garbage collection pauses get more frequent, and longer. If you're on a
>>memory-constrained machine, it's even worse, because garbage collection can
>>trigger swapping.
>>
>>
>>
>>

0
Comment actions Permalink

No. But that's an example of why I'm not doing M$ .crap development. All they do is feed the M$ marketing machine and nobody notices that developer studio .crap sucks. Jetbrains actually needs to provide a quality product.

Besides, anything that JetBrains can do to improve the initial impression of IDEA will result in more sales, and more $ for future enhancements of IDEA.

"Norris Shelton" <i.hate.spam@yahoo.com> wrote in message news:40A90C64.8090403@yahoo.com...
ROFL. That's funny. Think anybody at M$ is going to be doing that for .crap?

Norris Shelton
Sun Certified Java Programmer



Tim Haley wrote:
fwiw, I agree that if you have control over the purchase of hardware, upgrading can make a world of difference. I have no performance problems either at work or on my personal HP laptop. Of course both are P4 and have 1gig of memory. The desktop is a 3GHz and the laptop is a 2.33GHz. And I have developed a habit of clicking on the GC icon whenever the memory usage looks like it is creeping up. Especially I am about to do something that may be likely to push it even higher.

Before I was lucky enough to upgrade both systems I had the same complaint for IDEA 3.0 and Aurora.

Unfortunately, we can't always control the hardware that we are using. Our bosses do that.

I'm sure that I will have the same complaint in a year or two when the requirements for IDEA 5/6 increase and my hardware does not.

With that in mind, it would be extremely nice if someone at JetBrains was responsible for doing some performance testing and experimentation on low-end systems. Recommendations should be available for tweeking the runtime environment and IDEA configuration settings based on different generic hardware and OS configurations.

Tim

"Norris Shelton" <i.hate.spam@yahoo.com> wrote in message news:40A8FAEC.8080001@yahoo.com...
Me thinks you need to upgrade your hardware before downgrading your software. I run it on my ThinkPad laptop and it rocks with stock settings.

Maybe you can tweak your OS?

Norris Shelton
Sun Certified Java Programmer



Richard Kent wrote:
Just to say I've noticed this problem being much worse with version 4 than
it ever was for version 3. I have a gig of memory and have played with both
the intial and maximum heap sizes that IDEA runs with. None of this appears
to help and I still get long (eg sometimes 10 to 20 seconds) pauses
regularly. Our project isn't what I would call huge either (certainly not
"enterprise" level).

I think the general "bloat" (in terms of memory use and overall speed) that
has come about with version 4 is very bad for the software. Speed,
efficiency and low memory use were the primary reasons we chose IDEA over
Eclipse. Let's hope that regardless of whose "fault" the pauses are
(JRE/IDEA/setup/etc) that something can be done about it soon - I'm on the
verge of downgrading back to version 3 (and in fact have already done so on
my laptop) :(

Cheers,

TicH


"Derek Foster" <no_mail@jetbrains.com> wrote in message
news:24604146.1084660398268.JavaMail.itn@is.intellij.net...
It's been a significant problem for every user of Idea that I've seen (of
which there have been twenty or so). Once you work on a really big product,
the garbage collection pauses get more frequent, and longer. If you're on a
memory-constrained machine, it's even worse, because garbage collection can
trigger swapping.


0
Comment actions Permalink

Wrong on the minority thing. All 12 of us here that use IDEA with our project run into the long 10-20 second pause on GC. Many have switched to Eclipse which doesn't have this problem. (I guess they manage the GC better). Our machines are relatively slow at 1GHz with 512MB RAM, and management won't buy us new ones.

Rob.

0
Comment actions Permalink

AFAIK the only way you can 'manage' the GC is change the parameters fed
into the vm - all they do is give hints to how it should work. Have you
checked out the params for Eclipse to see what makes it work so good?
Maybe Eclipse allocates less memory dynamically or overall so GC isn't
triggered as often or atall?

JOI how memory hungry is Eclipse compared to IDEA?

Rob Andres wrote:

(I guess they manage the GC better)

0
Comment actions Permalink

I have a two-part solution for IJ 4.0 garbage collection:

1) Don't let anyone on my development team upgrade from 3.0 to 4.0

2) Uninstall 4.0 from my machine and reinstall 3.0

Seriously, 4.0 IS A PIG!!! In fact, I just watched it garbage collect while I was in an XML file. The GC freed up nearly 50 MB. I then started typing a comment in the XML file and I watched the memory usage start climbing as I typed in each new character! I typed maybe 20 total characters and the memory usage had jumped up by 30 additional MB!

What a piece of sh*t. I have been one of IJ's biggest proponents...but 4.0 is crap.


BTW, we have 2GHz P4s with 512 MB RAM. I know that we could use more RAM, but I have a big team and it takes time to upgrade given that we work for a large company and the machines are leased. Regardless, 3.0 works flawlessly on these boxes. What a massive step backward.

Steve

0
Comment actions Permalink

Nathan Brown wrote:

AFAIK the only way you can 'manage' the GC is change the parameters fed
into the vm - all they do is give hints to how it should work. Have you
checked out the params for Eclipse to see what makes it work so good?
Maybe Eclipse allocates less memory dynamically or overall so GC isn't
triggered as often or atall?


Or, you can try to reduce GC "churn" by not creating unnecessary
objects, using object pools, etc.

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919

0
Comment actions Permalink

>> Maybe Eclipse allocates less memory dynamically

Yeah that's what I was alluding to here...
N.

Gordon Tyler wrote:

Nathan Brown wrote:

>> AFAIK the only way you can 'manage' the GC is change the parameters
>> fed into the vm - all they do is give hints to how it should work.
>> Have you checked out the params for Eclipse to see what makes it work
>> so good? Maybe Eclipse allocates less memory dynamically or overall so
>> GC isn't triggered as often or atall?


Or, you can try to reduce GC "churn" by not creating unnecessary
objects, using object pools, etc.

Ciao,
Gordon

0

Please sign in to leave a comment.