Tags: atlantageek/gosnmp
Tags
Support SNMPv3 Encode/Decode (gosnmp#160) * Store MsgMaxSize, support SNMPv3 SnmpDecodePacket * Export MsgMaxSize * Add SetMsgID/SetRequestID, validate Encode/Decode
Optimize memory usage. If aggregating results from thousands of GetNext() calls in memory, the runtime seems unable to release some of the memory allocated by send() (or dispatch() now). The situation can be improved by copying the resliced response slice in dispatch(), rather than having the runtime keep a reference to a larger (and partially usefull) buffer array. This is the bug I was trying to squash in b84d786. The logic of adjusting the buffer size dynamically seems to be still valid though. With this change, the actual buffer size allocated to handle the response is no longer a problem so I changed the rxBufSizeMin and rxBufSizeMax to more aggressive/generous defaults (and min buffer size is proportional to request size). This will probably make buffer resizing an exceptional event.
PreviousNext