Jump to content
McKay Development

Possible memory leak


Yeezy

Recommended Posts

There's a possible memory leak in comps/friends.js or comps/familysharing.js
(edit: I could be wrong about where the leak is)
(please check my attached image)

The issue is rare and I'm unable to actively reproduce it yet, However it happens every 7 to 14 days after the App has been running for a while with 150~ instances of steamUser. (no memory leak until it happens)

 I will update this thread as I find more useful details to go on.

 

the only part of my code which interacts with the steamUserFriends

    steamUser.chat.on('friendMessage', async (message) => {
        if (config.autoReply) {
            if (!client.autoReplyRecipients.includes(message.steamid_friend.getSteamID64())) {
                client.autoReplyRecipients.push(message.steamid_friend.getSteamID64())
                steamUser.chat.sendFriendMessage(message.steamid_friend, config.autoReply)
                setTimeout((removeSteamId) => {
                    client.autoReplyRecipients = client.autoReplyRecipients.filter(steamId => steamId !== removeSteamId)
                }, 60000, message.steamid_friend.getSteamID64())
            }
        }
    })

    steamUser.on('friendRelationship', (sid, relationship) => {
        if (config.autoFriend && relationship == SteamUser.EFriendRelationship.RequestRecipient) {
            steamUser.addFriend(sid)
        }
    })

 

image.png

Edited by Yeezy
Link to comment
Share on other sites

Between your two screenshots, it kinda looks to me like g_ProcessPersonaSemaphore is somehow hanging at some point. The semaphore is backed by a linked list, and I see a lot of prev pointers in your OP screenshot. I don't really see why it would hang though, all code paths end in releasing the lock. That would also cause SteamID objects to pile up, as you're seeing in your heap snapshot.

In any case, try 4.28.4 and see if that fixes things for you.

Link to comment
Share on other sites

14 hours ago, Dr. McKay said:

Between your two screenshots, it kinda looks to me like g_ProcessPersonaSemaphore is somehow hanging at some point. The semaphore is backed by a linked list, and I see a lot of prev pointers in your OP screenshot. I don't really see why it would hang though, all code paths end in releasing the lock. That would also cause SteamID objects to pile up, as you're seeing in your heap snapshot.

In any case, try 4.28.4 and see if that fixes things for you.

Thank you, I'll try the update and let you know

Link to comment
Share on other sites

I don't have a snapshot from when the server was initialized but I have one from a server that was started at the exact same time and has the same amount of steamUser instances on it.

If there's anything specific you'd like me to try and/or look at please let me know.

 

no leak:

Screenshot2023-05-23at12_41_40.thumb.png.24fdad189eeaba05540e2fa4482014ac.png

Screenshot2023-05-23at12_41_48.thumb.png.a21f035194750deee6dffb4d93aeed36.png

 

leaked:

Screenshot2023-05-23at12_41_00.thumb.png.3998c27e88d3713f4e0bba1e05249129.png

Screenshot2023-05-23at12_41_33.thumb.png.e69e019a3ca0cd3e2892818b2f2b106e.png

Link to comment
Share on other sites

  • 2 weeks later...

4.28.4 still leaked memory unfortunately.

 

Running a test currently with the following handlers disabled:

EMsg.ClientPersonaState
EMsg.ClientClanState
EMsg.ClientFriendsList

It's been looking good so far no memory leak yet (running for 4+ days now)
 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...