camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-6452) FileUtil.getDefaultTempDir() causes a classloader leak in webapps
Date Fri, 14 Jun 2013 06:50:21 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-6452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13683150#comment-13683150
] 

Claus Ibsen commented on CAMEL-6452:
------------------------------------

Well even better this FileUtil temp dir logic is only used when stream caching is enabled.
We should ideally IMHO have StreamCaching setup its temp dir it want to use, and cleanup it
as well. And remove the logic from the FileUtil so its not required to delete using a JVM
shutdown hook.

Then we should also make configuring this on stream caching easier and more "Camelish" as
today you set some properties on CamelContext. Instead of using a <streamCache tempDir="xxx"
threshold="64mb" xxx/> or something. And then we should expose this in JMX so people can
see StreamCacheService in JMX and how its configured. And maybe even reconfigured it at runtime
etc.
                
> FileUtil.getDefaultTempDir() causes a classloader leak in webapps
> -----------------------------------------------------------------
>
>                 Key: CAMEL-6452
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6452
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.10.4
>         Environment: tomcat 7, spring 3.2
>            Reporter: Sanjay Deshmukh
>             Fix For: 2.10.5, 2.11.1, 2.12.0
>
>         Attachments: 0001-Fixed-CAMEL-6452-by-adding-a-cleanup-routine-to-remo.patch
>
>
> FileUtil.getDefaultTempDir() registers a JVM shutdown hook to delete the temporary directory
it creates. We are using camel in a web application in Tomcat that gets dynamically reloaded
as updates are available, so the JVM is normally never shut down. This is causing 'camel-tmp-*'
directories to linger in $CATALINA_HOME/temp, and - more importantly - classloader leaks,
which are a major problem for us.
> If the thread that gets registered as the shutdown hook were stored in a class variable,
I could unregister it when the application is being unloaded.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message