go-spacemesh icon indicating copy to clipboard operation
go-spacemesh copied to clipboard

hare: unnecessarily hogs memory

Open dshulyak opened this issue 2 years ago • 1 comments

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.

dshulyak avatar Feb 21 '22 04:02 dshulyak

  • [ ] 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?

jonZlotnik avatar Aug 29 '22 20:08 jonZlotnik