Resident set not decreasing after load decreased

45 views
Skip to first unread message

Dilshan Sandhu

unread,
Aug 4, 2023, 12:33:09 PM8/4/23
to golang-nuts
Hi,
I am working on a chat application build with golang. I am using open-source server tinode (https://github.com/tinode/chat) as base for my chat application. Issue is I am facing is the Resident set (as shown by top) shows very high memory usage after a load test ends. Also increasing channel capacity is resulting in higher end res value.
Some terminology about server. 
Topic:- Group is a topic, If i am coming online a topic is created, when two users chat, topic is created. 
I did some tests with different topic queue limits (hub.go:run():case join). Check scenario 1(og) and scenario2(modified). A gatling test was ran against both these conditions(and everything else same). At the start and end of each test(all ws closed), we noted the Resident Set (as given by htop)(these values remained stable after 5min also).
     Before    After
A  417M      1.71G
B  419M      2.09G

This indicates that the channels are not being cleaned for a topic which is not active. Any inputs would be helpful. 

Scenario1(A)
clientMsg: make(chan *ClientComMessage, 192),
serverMsg: make(chan *ServerComMessage, 64),
reg: make(chan *ClientComMessage, 256),
unreg: make(chan *ClientComMessage, 256),
meta: make(chan *ClientComMessage, 64),

Scenario2(B)
clientMsg: make(chan *ClientComMessage, 4096),
serverMsg: make(chan *ServerComMessage, 4096),
reg: make(chan *ClientComMessage, 4096),
unreg: make(chan *ClientComMessage, 4096),
meta: make(chan *ClientComMessage, 128),
At the start df

“The information contained in this message is intended for the addressee only and may contain classified information. If you are not the addressee, please delete this message and notify the sender; you should not copy or distribute this message or disclose its contents to anyone. Any views or opinions expressed in this message are those of the individual(s) and not necessarily of the Docquity. No reliance may be placed on this message without written confirmation from an authorised representative of its contents.”

Reply all
Reply to author
Forward
0 new messages