spring-projects / spring-integration-extensions

The Spring Integration Extensions project provides extension components for Spring Integration
http://www.springintegration.org/
280 stars 266 forks source link

Fix to memory leak when closing SmbSession #226

Closed beardy247 closed 4 years ago

beardy247 commented 4 years ago

Fix for issue #225

pivotal-issuemaster commented 4 years ago

@beardy247 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

pivotal-issuemaster commented 4 years ago

@beardy247 Thank you for signing the Contributor License Agreement!

beardy247 commented 4 years ago

Hold off on reviewing this for a while, I've been doing some more profiling and I don't think that I've eliminated the leak after all.

beardy247 commented 4 years ago

Hi @artembilan ,

I'll have a look at the indents, I didn't explicitly change anything but eclipse may have mangled it.

I have now properly got to the bottom of the memory leak, jcifs.CIFSContext doesn't implement Closable but it does have a close() method. The SmbShare(SmbConfig _smbConfig, Properties _props) constructor instantiates a BaseContext implementation of CIFSContext. My fix makes sure the BaseContext is closed if it's created in the constructor.