You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sending tables through TriggerClientEvent, memory is leaking. It is probably more noticeable with larger tables.
I'm using TriggerClientEvent a lot and my server RAM usage gradually increases from 500 MB to up to 10-15 GB at the end of the day (FXServer is being restarted daily).
Expected result
When sending table through TriggerClientEvent, allocated memory should be cleared.
local data = {}
for i = 1, 100000 do
data[i] = i
end
print(2, collectgarbage('count'))
for i = 1, 100 do
TriggerClientEvent("Test", playerid, data)
end
print(3, collectgarbage('count'))
data = nil
collectgarbage('collect')
print(4, collectgarbage('count'))
Importancy
Unknown
Area(s)
FXServer
Specific version(s)
Tested on FiveM artifact 12180 and 12651
I have confirmation from IllidanS4 that on some ancient artifact from 2022 this doesn't occur
Additional information
The garbage collect clears all the garbage, but RAM usage won't decrease.
Example of my results:
[ script:wtls] 1 354979.76171875
[ script:wtls] 2 359075.85546875
[ script:wtls] 3 395079.3125
[ script:wtls] 4 350609.63769531
Example of actual RAM usage:
560 MB RAM at the beginning
629 MB RAM after execution of the code above
580 MB RAM after few seconds and another manual garbage collect (just to be sure)
568 MB RAM after resource restart
You can easily repeat the test script and the RAM will gradually increase. I have suspicion, that this memory leak might somehow degrade CPU performance as well?
The text was updated successfully, but these errors were encountered:
I'm facing the same problem. It reaches 19GB; as soon as I open the server, it starts increasing by 2 to 4 MB per second as players join.
20 minutes after the first post, it's already at 4GB.
kicked all the players from the server and started stopping each resource one by one to see what was causing the memory consumption. I stopped all the resources, but it was still using 5GB.
What happened?
When sending tables through TriggerClientEvent, memory is leaking. It is probably more noticeable with larger tables.
I'm using TriggerClientEvent a lot and my server RAM usage gradually increases from 500 MB to up to 10-15 GB at the end of the day (FXServer is being restarted daily).
Expected result
When sending table through TriggerClientEvent, allocated memory should be cleared.
Reproduction steps
collectgarbage('stop')
print(1, collectgarbage('count'))
local data = {}
for i = 1, 100000 do
data[i] = i
end
print(2, collectgarbage('count'))
for i = 1, 100 do
TriggerClientEvent("Test", playerid, data)
end
print(3, collectgarbage('count'))
data = nil
collectgarbage('collect')
print(4, collectgarbage('count'))
Importancy
Unknown
Area(s)
FXServer
Specific version(s)
Tested on FiveM artifact 12180 and 12651
I have confirmation from IllidanS4 that on some ancient artifact from 2022 this doesn't occur
Additional information
The garbage collect clears all the garbage, but RAM usage won't decrease.
Example of my results:
[ script:wtls] 1 354979.76171875
[ script:wtls] 2 359075.85546875
[ script:wtls] 3 395079.3125
[ script:wtls] 4 350609.63769531
Example of actual RAM usage:
You can easily repeat the test script and the RAM will gradually increase. I have suspicion, that this memory leak might somehow degrade CPU performance as well?
The text was updated successfully, but these errors were encountered: