go-spacemesh
go-spacemesh copied to clipboard
hare: unnecessarily hogs memory
hare consistently hogs around 150 mb of memory. It is very likely an implementation mistake.
226 . . h := types.CalcMessageHash12(msg.Data, protoName)
227 . . msgLogger := logger.WithContext(messageCtx).WithFields(h)
228 . 21.51MB hareMsg, err := MessageFromBuffer(msg.Data)
229 . . if err != nil {
230 . . msgLogger.With().Error("could not build message", h, log.Err(err))
231 . . msg.Error <- err
232 . . continue
233 . . }
234 . . msgLogger = msgLogger.WithFields(hareMsg)
235 . .
Note that the diff shows where a fraction of the memory is allocated, not what doesn't allow to garbage collect it.
- [ ] Check if correlated with https://github.com/spacemeshos/go-spacemesh/issues/1143 Do we see the same memory consumption reported in this issue now that the scale codec is being used?