-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client side memory leak #140
Comments
It's nothing new that Client JS is full of memory leaks and unfortunately they are very hard to track down |
Well there's your problem. |
@Stuyk what do you mean? |
alt:V was never written with the intention of cleanup after reconnect. Yes it's a nice to have thing but there are certain things which cannot be cleaned up during the reconnection process. The code was written to be most performant during a single connection and a game reboot would be required to get that same performance on other servers. |
Its not about cleanup, its a memory leak in js module, that can be fixed (and yes, Leon already has replied that this is not an easy fix). And yes I know that reconnect (resource restart) is only for development (ofc you cant use it without debug mode xd) |
Fix of this issue can improve js development experience on alt:V, nothing more |
if you have gamemode that eats 100mb of the heap on first resource start and if you do 10-20 reconnects (resource restarts) your game will freeze on each resource start every reconnect for 5 or more seconds because of the heap overflow |
I also noticed this when I tested my server, GTA even crashed :( |
For an "easy" fix we could maybe just "restart" the script runtime on reconnect, so that it creates a new isolate on every reconnect. This would definitely fix all memory leaks (at least those originating from JS objects... xd) but I don't know whether that will fuck other shit up |
and if this fix turns out to be possible, resource restart will be overboard? |
I just pushed 6074731 which should definitely fix some memory leaks that existed before, someone can benchmark it to find out whether this improved anything |
i saw that, if u connect to the same server but without resources, it takes time to load resource but there no resources. |
Description of the problem
Reproduction steps
Reproduction steps
Check heap size in console
reconnect
Check heap size in console again
Expected behaviour
No memory leak!!
Additional context
No response
Operating system
Windows 11
Version
dev/10.0-dev12
Scope
client
The text was updated successfully, but these errors were encountered: