[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Heap Memory Usage  XML
Forum Index -> Quartz
Author Message
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());
}
}
jhouse

seraphim
[Avatar]
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?
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.
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1654
Online


Does it grow by a significant amount? (more than 1MB)?
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
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 [Disk] Download
 Description
 Filesize 41 Kbytes
 Downloaded:  43 time(s)

 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team