| Author |
Message |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 03/18/2012 19:05:39
|
mbcooray
neo
Joined: 03/18/2012 19:02:28
Messages: 4
Offline
|
Hi,
I wrote a simple Hello world and found that when the scheduler is waiting for the next execution the Heap memory is growing at a liner phase, and ofcause at actual job execution it creates a spike and drops.
my code is as below
public class SimpleExample {
public static void main(String[] args){
SchedulerFactory sf = new StdSchedulerFactory();
Scheduler sched;
try {
sched = sf.getScheduler();
String[] cronExpression = { "0 0/3 * * * ?"};
// define the job and tie it to our HelloJob class
JobDetail job = JobBuilder
.newJob((Class<? extends Job>) HelloJob.class)
.withIdentity("0","0").build();
// Trigger the job to run on the next round minute
Trigger trigger = TriggerBuilder .newTrigger()
.withIdentity("trigger" + 0,
"group" + 0)
.withSchedule(
CronScheduleBuilder
.cronSchedule(cronExpression[0]))
.build();
// Tell quartz to schedule the job using our trigger
sched.scheduleJob(job, trigger);
sched.start();
} catch (SchedulerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
=================================
public class HelloJob implements Job {
public void execute(JobExecutionContext context)
throws JobExecutionException {
// Say Hello to the World and display the date/time
System.out.println("Hello World! - " + new Date());
}
}
|
|
|
 |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 03/19/2012 11:26:35
|
jhouse
seraphim
Joined: 11/06/2009 15:29:56
Messages: 1654
Online
|
While we're pretty confident that there are no memory leaks (Quartz is using in hundreds-of-thousands of deployments, and we are receiving no reports of such), it obviously is still possible.
Can you provide more info about your config (e.g. quartz.properties)? Most particularly, which job store are you using?
|
|
|
 |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 03/19/2012 15:07:40
|
mbcooray
neo
Joined: 03/18/2012 19:02:28
Messages: 4
Offline
|
Hi,
Thank you for your reply, I have not changed any configuration. Just downloaded quartz-2.1.3 and started using. It is on default configurations. I tested it with one of the examples and monitored via JConsole.
The pattern that I am getting is while the quartz scheduler is waiting for a trigger the memory usage is climbing steadily and once the execution is up and running obviously the mem heap goes and once the execution is done it comes back to the original heap level.
So in this regard it is fine. But may I know why the heap mem usage is rising while it is waiting for a trigger?
Regards,
Mark.
|
|
|
 |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 03/19/2012 18:49:05
|
jhouse
seraphim
Joined: 11/06/2009 15:29:56
Messages: 1654
Online
|
Does it grow by a significant amount? (more than 1MB)?
|
|
|
 |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 03/19/2012 19:46:18
|
mbcooray
neo
Joined: 03/18/2012 19:02:28
Messages: 4
Offline
|
I have not recorded it. Let me try by giving a longer wait period for a trigger
|
|
|
 |
![[Post New]](/forums/templates/default/images/icon_minipost_new.gif) 03/19/2012 21:50:50
|
mbcooray
neo
Joined: 03/18/2012 19:02:28
Messages: 4
Offline
|
Ok I am attaching the .cvs file you can put it in to a graph and see... the steady clime is the waiting period and it drops sharply after execution and again climbs up
| Filename |
Quartz_Helloworld.csv |
Download
|
| Description |
|
| Filesize |
41 Kbytes
|
| Downloaded: |
43 time(s) |
|
|
|
 |
|
|