OutOfMemoryError: PermGen Space — Jasper Report with Spring running on Tomcat

前端 未结 5 1160
伪装坚强ぢ
伪装坚强ぢ 2021-01-02 11:00

Our web application encounter a complicated situation

It is a Spring application developed by STS/Tomcat 7. After the application been integrated with <

5条回答
  •  無奈伤痛
    2021-01-02 12:04

    Thank you everyone for giving solution about this issue, I have identified the problem specifically to my situation and here is the solution:

    Use .jasper instead of .jrxml as template !

    As we know .jasper is a compiled template as well as .jrxml is ASCII source code for the template, so if we use raw source code file (jrxml) as template in current spring application then at least spring frame work has to compile the source code file. That's a question of efficiency left to Spring framework as it is the jasper bean to handle the compilation and it is not guaranteed the compilation executed only once and only happens when the application starting.

    In short, after replace all templates with .jasper file, the log size has been significantly reduced and haven't seen the out of memory issue any more. I guess Spring container may be consume a lot of resource to compile jrxml to jasper at runtime. So it could be something should've improved by Jasper or Spring....

提交回复
热议问题