Skip to main content

System.gc() considered harmful

4 replies [Last post]
culli
Offline
Joined: 2006-09-17
Points: 0

I recommend that glassfish have the switch to disable explicit garbage collection with System.gc() included in the default installed setup. I inherited code with an explicit gc() call, and I suspect a 3rd party library was also calling it.

-XX:+DisableExplicitGC

This blog entry sums it up nicely: http://java-n-stuff.blogspot.com/2009/08/turn-on-disableexplicitgc-now.html

With this and some other performance tuning glassfish is running much better for me.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Alexis Moussine-Pouchkine

This makes sense.
Please file an issue @ https://glassfish.dev.java.net/issues/enter_bug.cgi?issue_type=DEFECT in the "performance" category.
I'll vote for it!

cheers,
-Alexis

On 11 juin 2010, at 21:59, glassfish@javadesktop.org wrote:

> I recommend that glassfish have the switch to disable explicit garbage collection with System.gc() included in the default installed setup. I inherited code with an explicit gc() call, and I suspect a 3rd party library was also calling it.
>
> -XX:+DisableExplicitGC
>
> This blog entry sums it up nicely: http://java-n-stuff.blogspot.com/2009/08/turn-on-disableexplicitgc-now.html
>
> With this and some other performance tuning glassfish is running much better for me.
> [Message sent by forum member 'culli']
>
> http://forums.java.net/jive/thread.jspa?messageID=473951
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Tim Quinn

One aspect to keep in mind...

Windows systems have the problem that open files cannot be deleted or
renamed. Open files - typically JARs - can be left open by
frameworks, application code, or bugs in the app server. Sometimes
these dangling open files are held open by unreachable object
references that have not yet be GCed. So, on Windows, GlassFish will
sometime try to run the GC to clean up these dangling references and,
thereby, close the open files.

We need to be careful making a blanket statement - and changing the
default setting for GlassFish - about this.

- Tim

On Jun 14, 2010, at 3:32 AM, Alexis Moussine-Pouchkine wrote:

> This makes sense.
> Please file an issue @ https://glassfish.dev.java.net/issues/enter_bug.cgi?issue_type=DEFECT
> in the "performance" category.
> I'll vote for it!
>
> cheers,
> -Alexis
>
> On 11 juin 2010, at 21:59, glassfish@javadesktop.org wrote:
>
>> I recommend that glassfish have the switch to disable explicit
>> garbage collection with System.gc() included in the default
>> installed setup. I inherited code with an explicit gc() call, and
>> I suspect a 3rd party library was also calling it.
>>
>> -XX:+DisableExplicitGC
>>
>> This blog entry sums it up nicely: http://java-n-stuff.blogspot.com/2009/08/turn-on-disableexplicitgc-now.html
>>
>> With this and some other performance tuning glassfish is running
>> much better for me.
>> [Message sent by forum member 'culli']
>>
>> http://forums.java.net/jive/thread.jspa?messageID=473951
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

Tim Quinn | Principal Member of Technical Staff | +1.847.604.9475
Oracle GlassFish Engineering
Lake Forest, IL

[att1.html]

Alexis Moussine-Pouchkine

thanks for the heads up Tim. How about we add it as a comment?
Let's discuss this further when the issue is filed.
-Alexis

On 14 juin 2010, at 15:33, Tim Quinn wrote:

> One aspect to keep in mind...
>
> Windows systems have the problem that open files cannot be deleted or renamed. Open files - typically JARs - can be left open by frameworks, application code, or bugs in the app server. Sometimes these dangling open files are held open by unreachable object references that have not yet be GCed. So, on Windows, GlassFish will sometime try to run the GC to clean up these dangling references and, thereby, close the open files.
>
> We need to be careful making a blanket statement - and changing the default setting for GlassFish - about this.
>
> - Tim
>
> On Jun 14, 2010, at 3:32 AM, Alexis Moussine-Pouchkine wrote:
>
>> This makes sense.
>> Please file an issue @ https://glassfish.dev.java.net/issues/enter_bug.cgi?issue_type=DEFECT in the "performance" category.
>> I'll vote for it!
>>
>> cheers,
>> -Alexis
>>
>> On 11 juin 2010, at 21:59, glassfish@javadesktop.org wrote:
>>
>>> I recommend that glassfish have the switch to disable explicit garbage collection with System.gc() included in the default installed setup. I inherited code with an explicit gc() call, and I suspect a 3rd party library was also calling it.
>>>
>>> -XX:+DisableExplicitGC
>>>
>>> This blog entry sums it up nicely: http://java-n-stuff.blogspot.com/2009/08/turn-on-disableexplicitgc-now.html
>>>
>>> With this and some other performance tuning glassfish is running much better for me.
>>> [Message sent by forum member 'culli']
>>>
>>> http://forums.java.net/jive/thread.jspa?messageID=473951
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>
>
>
>
> Tim Quinn | Principal Member of Technical Staff | +1.847.604.9475
> Oracle GlassFish Engineering
> Lake Forest, IL
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

culli
Offline
Joined: 2006-09-17
Points: 0