Hide Forgot
Date of First Response: 2009-04-14 06:26:25 Workaround Description: Remove the current smooks.esb/milyn-smooks-core-1.0.1.jar, replacing it by deploying both the aspectised version from this issue and the jboss-smooks-1.0.aop into smooks.esb. project_key: SOA For each incoming message some classes are instantiated (e.g. [org.milyn.javabean.BeanPopulator] Bean Populator created for [userNameToken:org.jboss.soa.esb.services.security.auth.ws.UsernameToken]), which are never released nor collected by GC. To reproduce the issue, you can use webservice_producer QS: ant deploy ant saygoodbye_over_http Attached is server.log and several profiling reports created by jProfiler. This issue is crashing one of our performance tests because the server runs out of memory.
Attachment: Added: server.log.bz2
Attachment: Added: jprofiler_reports.tar.bz2
A quick look at the profiler output would suggest that the following may be the cause of the leak. Each request results in a new WSSecurityInfoExtractor being instantiated which, in turn, creates a new Smooks instance. Each Smooks instance results in a new StandaloneApplicationContext which in turn instantiates SmooksResourceConfigurationStore. One leak, from a cursory inspection, would appear to be due to SmooksResourceConfigurationStore. During the construction of this class it will register a shutdown hook but this is never cleaned up, resulting in a hard reference to the SmooksResourceConfigurationStore. Other instances of this issue would appear to be present in AbstractStreamSplitter, SmooksHandler, SmooksMapper and SoapUIClientService. A quick fix would be to disable the shutdownHook for every instance of Smooks being created but the whole creation of the Smooks instance would appear to be heavyweight and it would be a better solution to handle this in a less resource intensive manner. The modification would be something like the following smooks.getApplicationContext().getStore().removeShutdownHook(); Kev
Link: Added: This issue depends JBESB-2520
Ah OK... this is actually a duplicate of SOA-1256, with the addition that Smooks.close() should be called as part of the cleanup of the ESB resources. close() will also remove that shutdown hook, as well as executing the cleanup of whatever resources are created/used.
It is not a duplicate but it is related. This is more general and affects other areas than the one mentioned in that issue.
Link: Added: This issue is related to SOA-1256
Attachment: Added: milyn-smooks-core-1.0.1.jar
Attachment: Added: jboss-smooks-1.0.aop
Hiya Martin. I have attached two jars which I believe will disable the smooks' shutdown hook. Could you please give these a try and see if this is the only source of a leak or whether there are also other issues? These should be placed within smooks.esb. Kev
Hello, the workaround has been successfully verified, although there seems to be slight (1-2%) performance hit.
Workaround Description: Added: Remove the current smooks.esb/milyn-smooks-core-1.0.1.jar, replacing it by deploying both the aspectised version from this issue and the jboss-smooks-1.0.aop into smooks.esb.
added to 4.3.CP02 release notes as resolved: JBESB-2520 - A number of services were leaking memory due the shutdown hook registered by org.milyn.cdr.SmooksResourceConfigurationStore() never being removed. The shutdown hook registration has been removed.
doh! That should read: JBESB-2520 - A memory leak affecting Smooks has been fixed. This was caused by the shutdown hook registered by org.milyn.cdr.SmooksResourceConfigurationStore() never being removed. The shutdown hook has been removed.
Verified with 4.3 C02 CR2