Jump to content
We've recently updated our Privacy Statement, available here ×

Memory leak in JR 3.7.3?


lacito

Recommended Posts

Dear developers,

We have developed a web application which uses JasperReports 3.7.3.

We use Tomcat 6.0.26 as a container. (Win XP, JDK 1.6.0_10)

We shutted down Tomcat, and we found the following messages in the catalina.log file:

SEVERE: A web application created a ThreadLocal with key of type [null] (value [net.sf.jasperreports.engine.util.JRFontUtil$1@19d373]) and a value of type [java.util.HashSet] (value [[]]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.

 

It seems to be a leak.

Can you confirm it?

Thanks,

Laszlo Sas

Link to comment
Share on other sites

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

That type of leaks cause problems when the web application is stopped or redepolyed (without restarting Tomcat).  If you don't do that, there are no reasons to worry.

In any case, log it as a bug and we'll see what we can do about it.

Regards,

Lucian

Link to comment
Share on other sites

  • 1 month later...
  • 5 weeks later...
  • 3 months later...

Hello JasperReports developers,

are you going to solve these redeploy memory leaks in JasperReports some day? May some financial contribution to your project encourage you to take interest in these nasty things? /tools/fckeditor/editor/images/smiley/msn/wink_smile.gif

I have already submitted two pathes fixing these memory leaks, but none of them has been accepted up to now (version 4.0.0). At least the BorderOffset patch is not breaking any original functionality.

I am asking epsecially to know If we can hope once these leaks will be solved or if we should change our deployment & release process to take into account and restart our server before each redeploy.

Thanks

Andy

Link to comment
Share on other sites

  • 2 months later...

I have found one more leak in SimpleFontExtensionHelper. If you make put SoftReference into the ThreadLocal then it is still memory leaking, since there is a circular reference! Furhemore, I if understand the code in net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries() - it right, then the SimpleFontExtensionHelper is initialized just once per class loader. So it is a nonses to cache its instances in ThreadLocal. Just create it, use it and forget it. No problems, no leaks.

Link to comment
Share on other sites

I apologize, it seems that SimpleFontExtensionHelper was not a source of the leak in my application. The ThreadLocal->SoftReference just holds the undeployed application in the memory for a few minutes. (Which is not nice, anyway.)

No I have a probem with the sun.awt.AppContext.getAppContext() memory leak, since JasperReports uses awt fotnts to measure text width. Grrr, this bloody Java class loader hell.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...