how about in-background garbage collection?

I find IDEA a very valuable product. I truly enjoy most of its features except on - performance.
I have P1.4/512MB RAM and every 30-60 mins IDEA stops for about one minute to do garbage collection + memory reservation (i.e. 77M/78M -> 45M/85M) . It's really annoying and to be honest IDEA is the only product I know that behaves like this. I know people who decided to move to other IDEs because of this problem.
Talking about this most of the people askes why doesn't IDEA control how intensive are user's actions and choose a moment to do GC based on this. Why wait until 77/78M and start GC automatically, if a user went for a coffee on 68/78M level, and he was answering a phone call on 76/78M?
I am sure a lot of people would appreciate this kind of solution.

Regards,
Piotr Martyniak

7 comments

why doesn't IDEA choose a moment to do GC


Do you really program in java? Or is it that you program in java and have no idea on how gc works?


Anyway, gc questions have been posted and answered several times. Search the groups/forums for -XX gc parameters for Idea.

0

Why wait until 77/78M and start GC automatically, if a user went
for a coffee on 68/78M level, and he was answering a phone call on
76/78M?

Hmm, how can IdeaIDE find out that your are just taking your coffee? :)

Ahmed.

0

Do you really program in java? Or is it that you program in java and have no idea on how gc works?


Hmm, could you explain me what are the relationship between my GC knowledge and this question?
If an operation needs time to take place - it seems to be quite natural to suggest doing it in a time when user is not in the middle of his work.

Anyway, gc questions have been posted and answered several times. Search the groups/forums for -XX gc parameters for Idea.


I don't read Idea forums, I just use the program. As I've said before I like IDEA very much and use it for my every day work. I've started this topic not to criticize the program, but to suggest something, what in my opinion would make it even better.
As I've said before, people give up using IDEA because of it's performance. Couple days ago friend told me he gave up Resharper because it does the same thing. -XX gc parameter seems to be interesting and I will read more about it in a moment, but people don't get IDEA with "read about -XX parameter" note. They turn it on and they want it to work efficiently.

Hmm, how can IdeaIDE find out that your are just taking your coffee? :)


People drinking coffee usually don't press keyboard or use mouse - IDEA could just control events coming from the user and start GC process when - for instance - user has not been using the program for 1 minute.

Regards,
Piotr Martyniak

0

Hi,

Explicit invoking of System.gc will collect objects of young generation
only that VM does fast anyway. However, before heap expansion or at low
memory condition Sun gc does scanning objects of old generations,
compacts memory heap with stopping all threads. So we could use
different gc or/and reduce garbage being created.

Piotr wrote:
>>Do you really program in java? Or is it that you program in java and have no idea on how gc works?


Hmm, could you explain me what are the relationship between my GC knowledge and this question?
If an operation needs time to take place - it seems to be quite natural to suggest doing it in a time when user is not in the middle of his work.

>>Anyway, gc questions have been posted and answered several times. Search the groups/forums for -XX gc parameters for Idea.


I don't read Idea forums, I just use the program. As I've said before I like IDEA very much and use it for my every day work. I've started this topic not to criticize the program, but to suggest something, what in my opinion would make it even better.
As I've said before, people give up using IDEA because of it's performance. Couple days ago friend told me he gave up Resharper because it does the same thing. -XX gc parameter seems to be interesting and I will read more about it in a moment, but people don't get IDEA with "read about -XX parameter" note. They turn it on and they want it to work efficiently.

>>Hmm, how can IdeaIDE find out that your are just taking your coffee? :)


People drinking coffee usually don't press keyboard or use mouse - IDEA could just control events coming from the user and start GC process when - for instance - user has not been using the program for 1 minute.

Regards,
Piotr Martyniak



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Piotr wrote:

>> Do you really program in java? Or is it that you program in java and
>> have no idea on how gc works?
>>

Hmm, could you explain me what are the relationship between my GC
knowledge and this question?


Are you aware that the JVM does GC automatically?
Are you aware that "Calling the gc method suggests that the Java Virtual Machine expend effort toward recycling unused objects in order to make the memory they currently occupy available for quick reuse." The JVM doesn't always do anything when this call is made.

This is a common issue with Java, not just IDEA. One that, supposedly, has been addressed in the latest release of the sun JVM. I have yet to try it out, however.

Tim

0

However, before heap expansion or at low memory
condition Sun gc does scanning objects of old
generations, compacts memory heap with stopping all
threads.


Thanks for explanation. I understand System.gc() is not enough to invoke deep garbage collection.
But if Sun gc starts "at low memory condition", maybe a Java program could artificialy create this kind of condition. If a Java program finds out, that it has not been used for last couple of minutes, it could i.e. start creating a big array of byte[] objects, which would invoke Sun gc.

Actually - after pressing "Run Garbage Collection" in IDEA I just had to wait 50 seconds. I am not sure if it really invokes only System.gc().

Even though I am definitely not a JVM specialist, it is really hard for me to believe it is impossible to invoke this Sun gc.

Anyway - thank you for your answers. It is good to hear the latest release of Sun's JVM does something with this and hopefully IDEA release without this limitation will appear soon.

Best regards,
Piotr Martyniak

0

Piotr wrote:

Actually - after pressing "Run Garbage Collection" in IDEA I just had to wait 50 seconds. I am not sure if it really invokes only System.gc().


50 seconds GC is not normal. Please make sure you are not using mapped
network drives and IDEA caches are on the local drive. Try to play with
the heap size and check that you have enough memory installed so that
IDEA is not moved into the swap space.

--
Serge Baranov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.