JS Api Memory leak

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

mizerakl
Posts: 4
Joined: 19 May 2017, 07:06

JS Api Memory leak

Postby mizerakl » 23 Mar 2018, 16:31

Hello.
Today I noticed a problem with a memory leak in the js client. The fact is that in the browser memory there are all objects that come with server updates and are not deleted from memory after their removal by the server. Every time a user moves around the game world, these objects accumulate and lead to significant memory costs.
Do you know the solution?

http://take.ms/xEAez - memory snapshot
JS Api version 1.2.0 (latest version also didn't help)
Java server version 2.12.0 (if it matters)

Thank you in advance for any help.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: JS Api Memory leak

Postby Lapo » 24 Mar 2018, 10:09

Hi,
I am not sure on which basis you think those objects shouldn't be in memory.

Objects in memory can exist for longer than they need to, if the garbage collector doesn't need to reclaim space, so I am not sure how you're determining that what you see is indeed a memory leak.

Can you clarify?
Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
mizerakl
Posts: 4
Joined: 19 May 2017, 07:06

Re: JS Api Memory leak

Postby mizerakl » 28 Mar 2018, 18:00

Hello.

I made this conclusion on the basis of the fact that I have never seen a decrease in the number of these objects. They are constantly growing with every move of the player in the game world.
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: JS Api Memory leak

Postby Bax » 29 Mar 2018, 09:32

Thank you for reporting this issue. We can confirm the memory leak, as MMOItems were incorrectly removed from the MMORoom.
You can get the updated API at the usual url: http://www.smartfoxserver.com/download/sfs2x#p=client
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 38 guests