| Summary: | org.eclipse.birt.core.script.ScriptEngineFactoryManager Memory Leak | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Scott Hamilton <scott.hamilton> |
| Component: | BIRT | Assignee: | Mingxia Wu <mwu> |
| Status: | RESOLVED WORKSFORME | QA Contact: | Xiaoying Gu <bluesoldier> |
| Severity: | critical | ||
| Priority: | P3 | CC: | arnaud.brunet, asenserini, bluesoldier, jouyang, lzhu |
| Version: | 2.6.1 | ||
| Target Milestone: | Future | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Scott Hamilton
Hamilton, Thank you for so detailed info. We will take a look and try to fix it next release. Lin Scott,
I tried to throw a runtime exception in method ILabelEventHandler.onCreate(), but failed to reproduce this problem, because report engine catches this exception immediately and add into error list, then releases all resources.
The code in Engine is as following:
try
{
ILabelInstance label = new LabelInstance( content, context,
RunningState.CREATE );
if ( handleScript( label, labelDesign.getOnCreate( ), context )
.didRun( ) )
return;
ILabelEventHandler eh = getEventHandler( labelDesign, context );
if ( eh != null )
eh.onCreate( label, context.getReportContext( ) );
}
catch ( Exception e )
{
addException( context, e, labelDesign.getHandle( ) );
}
All other event callbacks are invoked in the same way, which can ensure any runtime exceptions in event handler won't interrupt code following and all resources will be released correctly, unless an Error but not Exception is thrown. Was it an error in your case?
Cancelling report excution by IEngineTask.cancel() won't cause this problem either because the resources will also be released.
Could you please provide a sample design and its handler. It will be much helpful, thanks.
It's been a while since I posted this, so the exact details are no longer in my memory. However, we don't use many event callbacks - the error in question may have been coming from inside the OutputStream that BIRT was streaming its data into, or (as you probably know) the OutOfMemory error can erupt from just about any place in the code... Scott, I go through the code of Engine tasks( Run/RunAndRender/Render) and confirmed that they actually release all resources in finally block. I can't figure out any cases that might cause the issue you described, so I resolve this issue as "works for me", please feel free to reopen it if you reproduce this issue. |