Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Periodic platform restart
Periodic platform restart [message #650588] Tue, 25 January 2011 16:13 Go to next message
Lukasz Walach is currently offline Lukasz Walach
Messages: 4
Registered: January 2011
Junior Member
I need to schedule periodic platform restart in report generating tool, because of memory leaks in BIRT engine (bug 302242). Is there some simple way of getting number of currently running tasks to not interrupt them?

Lukasz
Re: Periodic platform restart [message #650613 is a reply to message #650588] Tue, 25 January 2011 16:53 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I do not think the engine keeps a record. The viewer implements this by
storing an id (task.getID()) for each task started by the engine. You
can use the task.getStatus() to determine when its finished.

Form the IEngineTask

static final int STATUS_NOT_STARTED = 0;
/**
* the task is running
*/
static final int STATUS_RUNNING = 1;
/**
* the task is finished with sucessful
*/
static final int STATUS_SUCCEEDED = 2;
/**
* the task is finished with errors
*/
static final int STATUS_FAILED = 3;
/**
* the task is finished by cancled
*/
static final int STATUS_CANCELLED = 4;

Jason

On 1/25/2011 11:13 AM, Lukasz Walach wrote:
> I need to schedule periodic platform restart in report generating tool,
> because of memory leaks in BIRT engine
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=302242). Is there some
> simple way of getting number of currently running tasks to not interrupt
> them?
>
> Lukasz
Re: Periodic platform restart [message #656722 is a reply to message #650613] Mon, 28 February 2011 09:35 Go to previous messageGo to next message
Lukasz Walach is currently offline Lukasz Walach
Messages: 4
Registered: January 2011
Junior Member
I've tried another approach:

I've put RunTask and RenderTask code into try{} finally{}
try{
BirtEngine.incrementRunningTasks();

// RunTask and RenderTask code

int runningTasks = BirtEngine.getRunningTasks()
if (runningTasks == 1){
    BirtEngine.destroyBirtEngine();
}

}finally{
    BirtEngine.decrementRunningTasks();
}

but it ended up with outOfMemoryException() after couple of reports and platform restarts. After some investigation I've found that it's because org.mozilla.javascript refuses to be garbage collected. Then I've added
org.mozilla.javascript.Context.exit();
after BirtEngine.destroyBirtEngine();
This time after couple more runs it was OutOfMemoryError: PermGen space. Then I've run into this bug 261845.
So my question is: does anyone have patched js.jar from 1.7R2 release? I'm trying to do this by myself but so far without success.

,
Lukasz

Jason Weathersby wrote on Tue, 25 January 2011 11:53
I do not think the engine keeps a record. The viewer implements this by
storing an id (task.getID()) for each task started by the engine. You
can use the task.getStatus() to determine when its finished.

Form the IEngineTask

static final int STATUS_NOT_STARTED = 0;
/**
* the task is running
*/
static final int STATUS_RUNNING = 1;
/**
* the task is finished with sucessful
*/
static final int STATUS_SUCCEEDED = 2;
/**
* the task is finished with errors
*/
static final int STATUS_FAILED = 3;
/**
* the task is finished by cancled
*/
static final int STATUS_CANCELLED = 4;

Jason
Re: Periodic platform restart [message #657219 is a reply to message #656722] Wed, 02 March 2011 00:03 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Lukasz,

Does the report you are running call any external Java classes?

Jason

On 2/28/2011 4:35 AM, Lukasz Walach wrote:
> I've tried another approach:
>
> I've put RunTask and RenderTask code into try{} finally{}
>
> try{
> BirtEngine.incrementRunningTasks();
>
> // RunTask and RenderTask code
>
> int runningTasks = BirtEngine.getRunningTasks()
> if (runningTasks == 1){
> BirtEngine.destroyBirtEngine();
> }
>
> }finally{
> BirtEngine.decrementRunningTasks();
> }
>
> but it ended up with outOfMemoryException() after couple of reports and
> platform restarts. After some investigation I've found that it's because
> org.mozilla.javascript refuses to be garbage collected. Then I've added
> org.mozilla.javascript.Context.exit(); after
> BirtEngine.destroyBirtEngine();
> This time after couple more runs it was OutOfMemoryError: PermGen space.
> Then I've run into this
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=261845
> So my question is: does anyone have patched js.jar from 1.7R2 release?
> I'm trying to do this by myself but so far without success.
>
> ,
> Lukasz
>
> Jason Weathersby wrote on Tue, 25 January 2011 11:53
>> I do not think the engine keeps a record. The viewer implements this
>> by storing an id (task.getID()) for each task started by the engine.
>> You can use the task.getStatus() to determine when its finished.
>>
>> Form the IEngineTask
>>
>> static final int STATUS_NOT_STARTED = 0;
>> /**
>> * the task is running
>> */
>> static final int STATUS_RUNNING = 1;
>> /**
>> * the task is finished with sucessful
>> */
>> static final int STATUS_SUCCEEDED = 2;
>> /**
>> * the task is finished with errors
>> */
>> static final int STATUS_FAILED = 3;
>> /**
>> * the task is finished by cancled
>> */
>> static final int STATUS_CANCELLED = 4;
>>
>> Jason
>
Re: Periodic platform restart [message #657377 is a reply to message #657219] Wed, 02 March 2011 15:48 Go to previous messageGo to next message
Lukasz Walach is currently offline Lukasz Walach
Messages: 4
Registered: January 2011
Junior Member
Jason,

No I have report with just one scripted data source. Nothing fancy, just displaying numbers. And actually I've patched rhino 1.7R2 with https://bugzilla.mozilla.org/show_bug.cgi?id=494665 but problem with org.mozilla.javascript not being garbage collected persists.

Lukasz
Re: Periodic platform restart [message #657396 is a reply to message #657377] Wed, 02 March 2011 16:36 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you add your comments to the bug? Any chance you can test this
without the scripted data source?

Jason

On 3/2/2011 10:48 AM, Lukasz Walach wrote:
> Jason,
>
> No I have report with just one scripted data source. Nothing fancy, just
> displaying numbers. And actually I've patched rhino 1.7R2 with
> https://bugzilla.mozilla.org/show_bug.cgi?id=494665 but problem with
> org.mozilla.javascript not being garbage collected persists.
>
> Lukasz
Re: Periodic platform restart [message #657474 is a reply to message #657396] Wed, 02 March 2011 21:45 Go to previous messageGo to next message
Lukasz Walach is currently offline Lukasz Walach
Messages: 4
Registered: January 2011
Junior Member
Yes, I'll comment this bug. Testing without scripted data source isn't a problem, but still I'll have to use some javascript in report to trigger loading org.mozilla.javascript class. Can you suggest something?

Lukasz
Re: Periodic platform restart [message #657486 is a reply to message #657474] Wed, 02 March 2011 23:09 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you write the scripted datasource using a Java event handler instead
of javascript?

Jason

On 3/2/2011 4:45 PM, Lukasz Walach wrote:
> Yes, I'll comment this bug. Testing without scripted data source isn't a
> problem, but still I'll have to use some javascript in report to trigger
> loading org.mozilla.javascript class. Can you suggest something?
>
> Lukasz
Previous Topic:Preventing SQL Injection
Next Topic:BIRT Multicolumn Report
Goto Forum:
  


Current Time: Sat Oct 25 11:59:22 GMT 2014

Powered by FUDForum. Page generated in 0.02540 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software