xmedeko Posted April 1, 2011 Share Posted April 1, 2011 Hello,JasperReports heavily use ThreadLocal and static HashMaps which may cause memory leaks in the servlet containers. I think the JasperReports configuration and startup should be redesigned and the good examples is a Hibernate project. It uses:Configuration (immutable, thread safe) -> SessionFactory (thread safe) -> Session (thread unsafe).So the SessionFactory is created just one per application (stored it the static variable, servlet context or bound to the JNDI.The JasperReponts could may useConfiguration (immutable, thread safe) -> ReportFactory (thread safe) -> new JasperReport (thread unsafe).All the resources, which are now cached in the ThreadLocal or static HashMaps would be cached in the Configuration or ReportFactory. Also, some utils to bind the ReportFactory to the JNDI would be nice. The JNDI may simplify usage of JasperReports in JEE environment.CheersAndy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now