Jump to content


Photo

Memory Leak in version 4

node.js node-steam-user

  • Please log in to reply
11 replies to this topic

#1 byteframe

byteframe

    Member

  • Member
  • PipPip
  • 25 posts

Posted 04 February 2019 - 11:27 AM

sorry to whine, but I am suffering from a memory leak issue with the version 4 branch. After disabling all my code, except for one account logging in, (and doing nothing) it still leaks. I left the one idle account running doing nothing and after about a day or so it exceeded the ~1.5 GB of heap the node process (by default) can use.

 

I then downgraded to 3.9.2 and it's fine now. I restored all the code and all the accounts are running and its been 12 hours now and memory usage is proper and garbage collecting is happening. It kinda seems like garbage collecting wasnt happening with v4, but I'm not sure exactly, as I didn't play around much with --expose-gc, yet. I quick glance suggested I couldnt just hack around this with manual global.gc() calls, but that would have probably been fine with me.

 

This happens on Linux and Windows, and im using node lts 10, linux from now on. What version does the the doctor use, btw?

 

I wish could be of more help, I tried generating heapdumps, but It locked up my machine, and I cant seem to get 'node-memwatch' installed/compiled, which had some event I maybe later could listen to that detects leaks. 

 

All the accounts are 'assigned/joined/ to a steam group chat however, a idle ghost town chat with nobody chatting in there, so maybe its likething related to (other) group chat events. Ill try to test this out next with an account who is not joined to a group chat.

 

thanks for looking.

 


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,188 posts

Posted 04 February 2019 - 09:08 PM

I'm using v10 right now.

 

I just set up a couple processes running on my Linux server generating heapdumps hourly. I'll let it run for a day or so and see what I can come up with.



#3 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,188 posts

Posted 06 February 2019 - 12:46 AM

Well, it's been over 24 hours now and both my test processes are still low on memory usage:

WS: 2019-02-06 00:43:13 - rss: 134.3 MB, heapTotal: 59 MB, heapUsed: 49.5 MB, external: 173.9 KB
TCP: 2019-02-06 00:43:27 - rss: 147.6 MB, heapTotal: 57.9 MB, heapUsed: 49.3 MB, external: 81 KB

One is connected to Steam using a WebSocket, the other using TCP. Both have just logged on and gone online on Steam, nothing more. Also, neither has crashed.

 

Node v10.15.0.



#4 byteframe

byteframe

    Member

  • Member
  • PipPip
  • 25 posts

Posted 06 February 2019 - 08:36 PM

are they joined to a group chat? all my accounts currently are. Ill try one without.



#5 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,188 posts

Posted 06 February 2019 - 11:18 PM

They weren't; I've just joined them to one.



#6 byteframe

byteframe

    Member

  • Member
  • PipPip
  • 25 posts

Posted 07 February 2019 - 12:00 PM

ok thank you for taking the time to test this out. if you cant find aything Ill have to resume banging my head against the wall on this



#7 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,188 posts

Posted 25 February 2019 - 04:46 AM

Can you please give v4.4.4 a shot and let me know if it improves anything?



#8 byteframe

byteframe

    Member

  • Member
  • PipPip
  • 25 posts

Posted 01 March 2019 - 11:52 AM

Certainly. 



#9 byteframe

byteframe

    Member

  • Member
  • PipPip
  • 25 posts

Posted 01 March 2019 - 12:23 PM

It still leaks memory like mad, but I'm convinced it's my fault, even though it is ok with the older branch. I think it's something related to my chat handling. I'll keep trying.



#10 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,188 posts

Posted 01 March 2019 - 06:50 PM

Since updating to 4.4.4, my memory-leak test setup isn't doing too badly. Just ~150 MB per instance.



#11 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,188 posts

Posted 14 March 2019 - 02:56 AM

My test instances still haven't gone above 150 MB (although one of them crashed on Tuesday because Steam gave it an InvalidPassword... stay classy Valve) so I'm going to go ahead and end this experiment. One of them was sending a chat message to a chat room both bots were in every second or so and still there was no significant memory usage.



#12 byteframe

byteframe

    Member

  • Member
  • PipPip
  • 25 posts

Posted 18 March 2019 - 07:22 PM

thank you very much for checking it out.







Also tagged with one or more of these keywords: node.js, node-steam-user

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users