arimu1 opened a new pull request, #913:
URL: https://github.com/apache/mina-sshd/pull/913

   Fixes #656
   
   ## Summary
   - When all piped data has been consumed, replace the internal 
`ByteArrayBuffer` with a fresh default-sized buffer instead of calling 
`compact()`, which only resets positions and leaves the large backing array 
allocated
   - On `eof()` with no unread data, apply the same shrink so cached SSH 
sessions do not retain ~512 KB per channel after command completion
   
   ## Test plan
   - [x] Added `bufferShrinksAfterAllDataRead` regression test (64 KiB payload; 
asserts backing array returns to `ByteArrayBuffer.DEFAULT_SIZE` after drain + 
EOF)
   - [x] Existing `ChannelPipedInputStreamTest` cases pass
   - [x] Command: `mvn -pl sshd-core -am -DskipTests install -q && mvn -pl 
sshd-core -Dtest=ChannelPipedInputStreamTest test` (Java 21, Maven 3.9.16)
   
   Made with [Cursor](https://cursor.com)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to