Jasperreport 6.0.0 memory leak

3

Hello,

I've a problem when I stop the server. I use jasperreport 6.0.0, tomcat 7.0.55.

When I stop the server I've this stacktrace : 

febr. 12, 2015 2:31:52 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Grave: The web application [/mywebapp] created a ThreadLocal with key of type [java.lang.ThreadLo
cal] (value [java.lang.ThreadLocal@38a9bc80]) and a value of type [java.lang.Class] (value [class pl
antime_report46jrxml_1423747396799_660787]) but failed to remove it when the web application was sto
pped. Threads are going to be renewed over time to try and avoid a probable memory leak.
 
febr. 12, 2015 2:31:52 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Grave: The web application [/mywebapp] created a ThreadLocal with key of type [net.sf.jasperrepor
ts.engine.fonts.FontUtil$1] (value [net.sf.jasperreports.engine.fonts.FontUtil$1@7cd7650f]) and a va
lue of type [java.util.HashSet] (value [[]]) but failed to remove it when the web application was st
opped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Here you can find the code : 
 
String reportPath = configurationService.getProperty("report.path");String reportName = configurationService.getProperty("report.pdf");if(!type) { reportName = configurationService.getProperty("report.xls");}
File reportFile = new File(reportPath, reportName);File reportCompiledFile = new File(reportPath, reportName + ".jasper");
if (!reportCompiledFile.exists() || reportFile.lastModified() > reportCompiledFile.lastModified()){ JasperDesign design = JRXmlLoader.load(reportFile); JasperCompileManager.compileReportToFile(design, reportCompiledFile.getAbsolutePath());}
JasperReport report = (JasperReport) JRLoader.loadObject(reportCompiledFile);
Driver driver = new Driver();DriverManager.registerDriver(driver);String url = configurationService.getProperty("dataSource.url");String login = configurationService.getProperty("dataSource.username");String pswd = configurationService.getProperty("dataSource.password");Connection con = (Connection) DriverManager.getConnection(url,login, pswd);
JasperPrint print = JasperFillManager.fillReport(report, parameters, con);
String fileName = parameters.get("lastName") + "-" + FormatUtils.FORMAT_DMYHMS.format(new Date());if(type) { fileName = fileName + ".pdf"; JasperExportManager.exportReportToPdfFile(print, dest.getAbsolutePath()+"\\"+fileName);} else { fileName = fileName + ".xls"; JRXlsExporter exporter = new JRXlsExporter(); exporter.setExporterInput(new SimpleExporterInput(print)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(dest.getAbsoluteFile() + "\\" + fileName)); SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration(); configuration.setOnePagePerSheet(false); configuration.setDetectCellType(true); configuration.setCollapseRowSpan(true); exporter.setConfiguration(configuration); exporter.exportReport();}
con.close();
The reports are generated in pdf or XLS. It's work fine. How can I removed the problem whith the memory leak ?
Can anyone help pls to solve this issue.
Thank you all in anticippation.
arbenghanam's picture
Joined: Feb 12 2015 - 7:33am
Last seen: 4 years 2 months ago

Excatly the same issue in 6.7.0. Is there a soultion?

loebe - 7 months 2 weeks ago

Excatly the same issue . Is there a soultion?

sc_sad - 3 months 3 weeks ago

0 Answers:

No answers yet
Feedback
randomness