snclient icon indicating copy to clipboard operation
snclient copied to clipboard

Memory leak on verison 0.24

Open pyves007 opened this issue 1 year ago • 16 comments

Hello, after have tested the version 0.24.0 since the 27th May, it seems that there is steal some memory leaks. image I could imagine that we are not alone with this issue. Have a nice day, Py

pyves007 avatar Jun 11 '24 07:06 pyves007

so far, i cannot see any memory issues with the 0.24 on any of the systems i have control of. What are you plotting there? And maybe add some information about which os that is or so?

sni avatar Jun 11 '24 07:06 sni

hello

I confirm that the memory leak is still present I saw it on Windows Server 2016 and 2019 I have a suspicion about "wrapped scripts"...

before: memory_snclient1

after: memory_snclient2

k9fr4n avatar Jun 13 '24 08:06 k9fr4n

yeah, would be helpful if you could pin down the leak to some specific functionality.

sni avatar Jun 13 '24 13:06 sni

@pyves007 @FranckSallet we just released 0.25 - it reduces memory usage overall. Could you please give us feedback with that version?

lgmu avatar Jun 14 '24 13:06 lgmu

Thank you, i'll test it.

pyves007 avatar Jun 14 '24 13:06 pyves007

I installed it on a windows server 2019 on friday and didn't notice anything regarding memory usage over the weekend. If you still have this issue, please attach your config and let us know which features you use.

lgmu avatar Jun 17 '24 06:06 lgmu

Hi

memory leak is still present in version 0.25 I notice that the memory issue seems not to be present when using just the builtin check command. Snclient's memory increases each time an "external script" is used.

Regards

k9fr4n avatar Jun 18 '24 14:06 k9fr4n

Hi, thanks for your feedback. I could see a slight increase in memory usage when executing ps1 Scripts. Are you also running ps1 scripts or something else?

lgmu avatar Jun 18 '24 15:06 lgmu

yes, mainly powershell scripts

k9fr4n avatar Jun 19 '24 08:06 k9fr4n

I've tested this with 1000 executions of a ps1 script, but the memory only increased from 12 to around 16MB. How long do your powershell scripts run? Could you check if a particular one causes this?

lgmu avatar Jun 19 '24 09:06 lgmu

i cannot reproduce it either. Running ps1 scripts and wrapped ps1 script in a loop but the memory usage is stable.

Could you try to pin this issue (if it still occurs) to a specific check? That would be helpful.

sni avatar Jul 17 '24 13:07 sni

after analysis, I see that the memory leak is located on the default checks I use the check_tasksched via an alias and each time this check is used, the memory increases present on version 0.26

k9fr4n avatar Aug 13 '24 10:08 k9fr4n

Thanks, I'll try to reproduce it when I find time for it

lgmu avatar Aug 13 '24 11:08 lgmu

Hello, and thanks to @FranckSallet , i was testing each checks separately also, i have arrived at the same conclusion, i can also said that only the check check_tasksched is producing memory leak. image

pyves007 avatar Aug 14 '24 06:08 pyves007

Thanks for the input, I can reproduce this with 0.26 - we will fix it

lgmu avatar Aug 14 '24 08:08 lgmu

Issue might be here

lgmu avatar Aug 14 '24 08:08 lgmu

should be fine now, i replaced the 3rd party module with a powershell script. This makes retrieving scheduled tasks a bit slower, but memory was stable in my tests so far.

sni avatar Sep 02 '24 14:09 sni

@FranckSallet @pyves007 Is the issue resolved for you guys?

lgmu avatar Sep 12 '24 13:09 lgmu

@lgmu Hello, we are not using anymore the Task Scheduler check so no more memory issue from our side.

pyves007 avatar Sep 25 '24 11:09 pyves007