-
-
Notifications
You must be signed in to change notification settings - Fork 979
Open
Description
Hi,
I noticed using SSH.Net there are a few issues using SshCommand:
- Allocation of 2kB of buffer for every command, even short ones without output and without monitoring output
- Not reading output causes these buffers to grow indefinitely for long running commands
- No way to discard this output easily
- Using sshcommands many at a time in a pool causes huge GC pressure with the many large allocations
An example from a single command running without cleaning the streams shows it allocating over 300kB of memory in a VS snapshot.
Possible solutions:
- Allocate the pipestreams only when accessed, discarding input otherwise (breaking change)
- Creating a new sshcommand that does not allocate.
I will be creating a pull request for scenario 2 as i need a solution for a project asap.
Thanks for the library!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels