Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT Memory leak
bognekadje
Hi everybody,
I testing a web application with Google Web Toolkit and BIRT 3.7.1 API. My application design a view and can make report slideshows which are refresh(means that report are re-generate). My application is deployed on Tomcat 5.5.
Problem occurs because with Windows Task manager, memory use by Tomcat grows continously and at the end report generation failed because there is not enough memory. I have made heap dump using VisualVM and look them, but i don't have any idea about problem.
I have some questions:
- has BIRT 3.7.1 some memory leak problem
- is it a classloader memory leak and how to use classloader for ReportEngine and EngineTask
- shoold i see with Tomcat
Please help me.
Thanks for reply.
Find more posts tagged with
Comments
CBR
Can you post the code that interacts with the report engine api to generate your reports?
bognekadje
thanks cbrell for reply,
In fact i have class which create ReportEngine and that implements Singleton Pattern.
I use following code to create ReportEngine
public static synchronized IReportEngine getReportEngine(ServletContext sc)
throws BirtException {
if (reportEngine == null) {
EngineConfig config = new EngineConfig();
config.setLogConfig(ServerTools.BIRT_LOG_DIRECTORY,
getBIRTLogLevel(ServerTools.BIRT_LOG_LEVEL));
config.setResourcePath(ServerTools.BIRT_RESOURCE_PATH);
config.setLogRollingSize(ServerTools.BIRT_LOG_ROLLING_SIZE);
config.setLogMaxBackupIndex(ServerTools.BIRT_LOG_MAX_BACKUP_INDEX);
config.getAppContext().put(
EngineConstants.APPCONTEXT_CLASSLOADER_KEY,
BirtEngineHelper.class.getClassLoader());
IPlatformContext context = new PlatformServletContext(sc);
config.setPlatformContext(context);
try {
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
reportEngine = factory.createReportEngine(config);
log.debug("ReportEngine is created.");
} catch (BirtException e) {
log.error("BIRT engine creation failed \n "
+ ServerTools.getStackTraceAsString(e));
throw e;
}
}
return reportEngine;
}
And for each request, i use the single ReportEngine in service to create either IRunTask or IrenderTask and then generate report. for Example this methods use to create rptdocument files
public void createRptdocument(ReportView rv, String locale)
throws NullPointerException, SecurityException,
IllegalArgumentException, BirtException {
IRunTask runTask = null;
IReportDocument reportDocument = null;
try {
File f = new File(rv.getPath());
String path;
if (f.isAbsolute()) {
path = new String(rv.getPath());
} else {
path = ServerTools.DESIGN_FOLDER + rv.getPath();
}
IReportEngine reportEngine = BirtEngineHelper
.getReportEngine(getServletContext());
IReportRunnable reportRun = reportEngine.openReportDesign(path);
runTask = reportEngine.createRunTask(reportRun);
// runTask.getAppContext().put(
// EngineConstants.APPCONTEXT_CLASSLOADER_KEY,
// IRunTask.class.getClassLoader());
setValueRunTaskReport(runTask, rv);
runTask.setLocale(ServerTools.getLocale(locale));
String documentPath = ViewingSessionManager.getInstance()
.getSession(rv.getViewingSessionId()).getDocumentPath();
runTask.run(documentPath);
reportDocument = reportEngine.openReportDocument(documentPath);
rv.setPageCount((int) reportDocument.getPageCount());
} finally {
if (runTask != null) {
runTask.close();
}
if (reportDocument != null) {
reportDocument.close();
}
}
}
thanks for your help!
evgenyak
<p>Did you get any replies regarding leaks in 3.7.1?</p>
Yaytay
I always had problem with memory leaks when using the OSGi report engine, when I switched to the POJO engine I had no further problems.
Jim
evgenyak
<p>I'm using POJO 3.7.1 engine.</p><p>I wanted to upgrade but I saw that 4.2.2 has memory problems as well.</p><p>Which version are you using?</p>
Yaytay
<p>I've got 3.7.2 POJO in live and 4.2.2 POJO just waiting for my users to switch over to it.</p><p> </p><p>BIRT uses a lot of memory, but I haven't had <em>leaks</em> since I switched to POJO (which I think was 3.7.0).</p><p> </p><p>Jim</p>
evgenyak
<p>It is possible also that I'm doing something wrong and confusing between OSGI and POJO.</p><p> </p><p>I am putting different BIRT libs under WEB-INF/lib insider my WAR.</p><p>I was sure I was using POJO</p><p>However, now, I noticed I have a couple of OSGI related jars there. Does it mean I'm doing OSGI?</p>