grpc-node icon indicating copy to clipboard operation
grpc-node copied to clipboard

A potential memory leak in ChannelzTrace

Open sasaxing opened this issue 7 months ago • 1 comments

This is more a question rather than a bug report.

I see it in my NodeJS server, after an active session, there are quite a few Date object retained in the heap. The retainer refers me to the ChannelzTrace.events. Reading the code, it looks like the events array is never cleaned up.

Does it make sense to remove the event once it's logged?

sasaxing avatar Jun 13 '25 15:06 sasaxing

The ChannelzTrace object should be cleaned up when the object that owns it is released. In particular, if you .close() a Client object, it should release all of the channelz traces associated with it.

murgatroid99 avatar Jun 13 '25 16:06 murgatroid99