"Write Marshalled" lag spikes

On certain triggerable events I keep getting a massive lagspike from “Write Marshalled” these events have existed for a very long time in my game, and write marshalled only started appearing after I made an update to the game.

I have no idea what Write Marshalled is, and if you search it on the dev forumn, you’ll get posts from 2018 saying the write marshalled lag spikes are a bug roblox needs to fix. Unfortunately this is causing some pretty bad effects in my game, is there any solution?

6 Likes

Write Marshaled is when data are converted to a stream to be sent over the network. You might accidentally be sending a huge object. Try and isolate the specific remote that is causing it.

Well I know how to replicate it exactly, but the code as always worked perfectly fine in the past. Is there a way I can actually track whats causing the lag?

Yo I got this problem too, Never had it before, And after disabling almost everything and disabling all remote calls to clients, It still freeze for 200ms

1 Like

I replicated this by destroying a script while running the game, whether disabled or a module script.

3 Likes

Still getting this issue, wondering if its still happening for you guys? Or if you found a solution

lol i’ve just sucked it up and it become apart of the game, tell me if you find anything yourself

For me it was caused by mass replication. Cloning items with a crap ton of children

Just by having them in memory? Or actually cloning stuff the moment it spikes?

1 Like

Cloning stuff the moment it spikes.

1 Like

I got the same when i destroy my Hoverbike (including its client and server and module script) and then spawn from backpack)

2 Likes

This more than likely is just something with Roblox. I was having an issue with getting a write marshalled lag spike when dying and respawning in a completely empty baseplate with no scripts running.

Write Marshalled appears most likely when you’re deleting a script. If that script has leftover connections (especially ChildRemoved) or oversized tables, those can lag the VM state

Edit: Happens when you delete scripts in general

(I had to use ChatGPT sry)

1 Like