Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JasperReports Memory Leak

I am working in a webapp, it uses JasperReports 5 (jasperreports-5.0.1.jar) but is leaking memory until java.lang.OutOfMemoryError, this app generates dinamic reports between 10 to 100 pages.

I am using MAT in order to know what is going on, as you can see in the following pictures, JasperReports is retaining memory:

net.sf.jasperreports.engine.export.legacy.BorderOffset$1

Histogram of grouped by package: Histogram of grouped by package

The names Plantilla and SubReport in Histogram are clases related to our reports generated with JasperReports.

This web app runs on the following environment:

-WebLogic 11g

-jrockit-jdk1.6.0_45-R28.2.7-4.1.0

-Xms2048m -Xmx2048m

-Oracle Linux

If you have faced something similar, let me know your expirience.

like image 897
dogmeat Avatar asked Jul 20 '16 18:07

dogmeat


1 Answers

use .jasper file to fill the report instead of .jrxml because.jasper is compiled format and . jrxml is not compiled , where ever you try to fill the report by using .jrxml it first compile and then do the rest processing which results in more memory consumption

like image 80
Pradeep Avatar answered Oct 03 '22 01:10

Pradeep