Scheduling Garbage Collection Job - SwiftMQ 9.4.2

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Scheduling Garbage Collection Job - SwiftMQ 9.4.2

sanjan
Hi, Can you enlighten me a bit about garbage collection scheduled job.
I'm running SwiftMQ 9.4.2 on Java 1.7.67
Recently we saw some GC related out of memory errors in some of our routers.
and a colleague of mine suggested to have a job like below:

router1/sys$scheduler/schedules> lc gcjob
Entity:      Job Schedule
Description: Job Schedule

Properties for this Entity:

Name                                    Current Value
--------------------------------------------------------------
calendar                                <not set>
date-from                               now
date-to                                 forever
enabled                                 true
job-group (R/O)                         .env
job-name (R/O)                          gc
logging-enabled                         true
max-runtime                             <not set>
time-expression                         at 05:00


I would like to know whether running this one time a day is sufficient?
If not what is the recommended frequency?
by default how often a GC will be done (As far as I know it's done by JVM and not controlled by the application)?  

Can I schedule this job to run, let's say "hourly"?  Time-expression template not that clear on it.

Property Name  : time-expression
Display Name   : Time Expression
Description    : ('at' HH:mm[:ss][, HH:mm[:ss]...]) | ('start' HH:mm[:ss] 'stop' HH:mm[:ss] 'delay' n('s'|'m'|'h' ['repeat' n])
Type           : class java.lang.String
Min. Value     : <not set>
Max. Value     : <not set>
Default Value  : <not set>
Poss. Values   : <not set>
Mandatory     : true
Read Only      : false
Reboot Required: false

Reply | Threaded
Open this post in threaded view
|

Re: Scheduling Garbage Collection Job - SwiftMQ 9.4.2

sanjan
Also is there a way to know how long the scheduled job was running.
Is there any logging about when the job started and finished?
Reply | Threaded
Open this post in threaded view
|

Re: Scheduling Garbage Collection Job - SwiftMQ 9.4.2

IIT Software
Administrator
sanjan wrote
Also is there a way to know how long the scheduled job was running.
Is there any logging about when the job started and finished?
Yes. The information is on this page ("Logging Enabled").

GC only becomes an issue if you overload the memory, that is, ALL memory has been allocated and the GC cannot release it (because it's allocated). Otherwise just don't touch the GC, it works very well without any intervention.

In your case that means to check where you did allocate the memory and avoid it or add more heap (-Xmx).
Reply | Threaded
Open this post in threaded view
|

Re: Scheduling Garbage Collection Job - SwiftMQ 9.4.2

sanjan
Ok. understand your answer. but just curious, why such command exists in the swiftmq router?
is it because previous versions of java vm did not do a proper job in garbage collection?
Reply | Threaded
Open this post in threaded view
|

Re: Scheduling Garbage Collection Job - SwiftMQ 9.4.2

IIT Software
Administrator
The GC command is useful if you invoke it from SwiftMQ Explorer or CLI to initiate a full GC just to see how much memory is really occupied at that time.