Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak when used in webapps #96

Open
TheAustinSwamy opened this issue Jun 27, 2024 · 0 comments
Open

Memory leak when used in webapps #96

TheAustinSwamy opened this issue Jun 27, 2024 · 0 comments

Comments

@TheAustinSwamy
Copy link

The Shutdown hook is registered twice in SshEngine when using default instance and both are not removed if the maverick client library is used in a web application thereby causing memory leaks.

SshEngine getDefaultInstance() method calls the startup() method and this method registers a shutdown hook.

Lines 242-243 (SshEngine.java)
if (Runtime.getRuntime() != null)
Runtime.getRuntime().addShutdownHook(shutdownHook);

SshEngine.getDefaultInstance() ALSO registers a shutdown hook. Lines 1203-1207.

During shutdown, only the first one is removed from the ApplicationHooks and thereby causing leaks.

The registration in Lines 1203-1207 of SshEngine.java is not necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant