jQuery in Action, 2nd edition*
The moose likes JBoss/WildFly and the fly likes Difference between client.gcInterval and server.gcInterval Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Difference between client.gcInterval and server.gcInterval" Watch "Difference between client.gcInterval and server.gcInterval" New topic
Author

Difference between client.gcInterval and server.gcInterval

Neha Mohit
Ranch Hand

Joined: Apr 25, 2006
Posts: 87
Hi all,

What is the difference between

-Dsun.rmi.dgc.client.gcInterval

-Dsun.rmi.dgc.server.gcInterval

given in run.bat file of JBOSS , are the values given to them related . I want to invoke garbage collector on my server heap ; so does that mean i have to just change the value of "-Dsun.rmi.dgc.server.gcInterval"


-Thanks in advance


Neha
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

These setting have to do with applications that participate in remote method invocation (RMI). The "server" setting applies to applications that act as RMI servers (JBossAS qualifies as a server due to JNDI, EJBs deployed, and I think even running the JMS server and web services). The "client" setting applies to app that run as an RMI client - that is, they make calls to an RMI server. This includes any deployed apps that call another server. Example - you have servlets that make calls to EJBs in another JBossAS instance.

The idea behind both settings is that RMI causes both the server and the client to create temporary objects on the heap, and those objects need to be garbage collected. So these timers automatically force a garbage collection at the given interval. The bad news is that they force a major collection, which is usually very costly. Besides, the temp rmi objects these settings are meant to collect are collected anyway during normal minor and major collections. Therefore, the act of running a collection specifically for rmi objects in an app server is ridiculous - the objects that it attempted to clean up are probably already out of the heap.

I recommend making these settings as high as possible. The current setting came from our testing with specjappserver (a j2ee benchmark) which runs for about 40 minutes. The settings force rmi to not run a gc for an hour, which enabled us to avoid having a major collection while running the benchmark. But for production, you want an even higher value. The value is stored in a long, so I would give it Long.MAX_VALUE.

If you are really interested in setting when GC takes place, I recommend making he proper heap settings. And I also recommend reading the performance chapter in JBoss in Action.
[ May 21, 2008: Message edited by: Peter Johnson ]

JBoss In Action
Neha Mohit
Ranch Hand

Joined: Apr 25, 2006
Posts: 87
Thanks Peter , sure will do read the chapter
 
jQuery in Action, 2nd edition
 
subject: Difference between client.gcInterval and server.gcInterval
 
Similar Threads
Aggregation and Association
doubt: equals&==
OutOfMemoryError: java heap size while starting jboss4.2.2 in solaris
Difference between Compiler Error & Runtime Exception
Too big memory size assigned for JBoss?