6

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.

Alex K
  • 22,315
  • 19
  • 108
  • 236
dogmeat
  • 61
  • 1
  • 3
  • 1) Maybe your code don't release resources. What about the resource management in your code? 2) Did you try to use JR 6.3 version (or 6.2)? 3) Did you try to use Oracle jre/jdk and the jdk8? – Alex K Jul 20 '16 at 19:36
  • 1
    Try setting the net.sf.jasperreports.evaluator.class.reference.fix.enabled property to false in your jasperreports.properties, it might help. – dada67 Jul 20 '16 at 20:45
  • What do you mean with resource management?, I did not try with another JR version, using oracle jdk is not an option 'cause is what we have in production. – dogmeat Jul 20 '16 at 20:50
  • @dogmeat Did you try the solution by @data67? – Alex K Jul 22 '16 at 07:36

1 Answers1

3

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

Pradeep
  • 75
  • 7