AlexStocks commented on a change in pull request #76:
URL: https://github.com/apache/dubbo-getty/pull/76#discussion_r711415672



##########
File path: session.go
##########
@@ -607,12 +607,10 @@ func (s *session) handleTCPPackage() error {
        bufp = gxbytes.GetBytes(maxReadBufLen)
        buf = *bufp
 
-       // pktBuf = new(bytes.Buffer)
-       pktBuf = gxbytes.GetBytesBuffer()
+       pktBuf = new(bytes.Buffer)
 
        defer func() {
                gxbytes.PutBytes(bufp)
-               gxbytes.PutBytesBuffer(pktBuf)

Review comment:
       就算按照你这个改进,这个 defer 根本就不需要了。因为你每个 pkgBuf 都是 new 出来的。对 gxbytes 中的 缓存池而言,只有 
put 没有 get,还是会造成内存被缓存。




-- 
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