fivem icon indicating copy to clipboard operation
fivem copied to clipboard

Server crash when trying to create 100k objects (server setter)

Open spacevx opened this issue 1 year ago • 5 comments

What happened?

When creating 100k objects on the server side the server is crashing

Expected result

Not crashing

Reproduction steps

local coords = vec3(148.85, -1393.22, 29.29) -- put coords here
local count = 0
for i = 1, 1000000 do
    local t = CreateObjectNoOffset(`sum_ac_prop_container_01a`, coords.x, coords.y, coords.z, true, true)
    print(t)
    if (t ~= nil) then
     count += 1
    end
end
print(count)

Importancy

Crash

Area(s)

FXServer

Specific version(s)

FiveM

Additional information

No response

spacevx avatar Jun 30 '24 15:06 spacevx

Can you post the crash dump? Also 10k networked objects? Just why? Maybe because you hit the limit ?

outsider31000 avatar Jun 30 '24 16:06 outsider31000

100_000 that does not look like 10k to me...

AvarianKnight avatar Jun 30 '24 17:06 AvarianKnight

100_000 that does not look like 10k to me...

My bad

spacevx avatar Jun 30 '24 20:06 spacevx

Can you post the crash dump? Also 10k networked objects? Just why? Maybe because you hit the limit ?

I was trying to found this limit but the server crashed, and even if a limit exist, the server shouln't crash

spacevx avatar Jun 30 '24 20:06 spacevx

I would argue that a server 'crash'/main thread hang is expected when running a blocking loop with 10k+ iterations, this has nothing to do with the native/object creation itself.

But even when applying reasonable pause times, a count of 100k+ networked objects is not reasonable at all and should never happen in the first place, as you will run into other limitations way earlier.

tens0rfl0w avatar Jul 01 '24 11:07 tens0rfl0w