Performance issue with PhysicsParts and GraphicsParts

So I was making this ragdoll game, whereas you shoot a player and they go on a ragdoll state. I checked the memory consumption and in about 10 minutes, it had exceeded >1500MB with about 10 players in the game.

Core memory was fine, reaching a maximum of <400MB, but PlaceMemory reached >1200MB from PhysicsParts and GraphicsParts as shown.

I presume it’s the ragdoll causing this issue. I used this module

I toggle ragdoll using CollectionService:AddTag(player.Character, “Ragdoll”) and remove it via CollectionService:RemoveTag(player.Character, “Ragdoll”).

The map is hardly performant, with little to no textures. When I shoot/toggle the ragdoll, memory starts to build up as well as ping. Any solutions toward this?

You could try developing your own Ragdoll Module to suit your games needs. When you create your own resources (modules like so) built for your game, they’ll always be more performant than freemodel scripts.

You can either try to fork their code or create your own, a but a way to release stress on the server and lower memory, I suggest anchoring the players ragdoll after a few seconds and then disabling CanTouch and CanCollide on all their descendants. This will reduce physics calculation as they’re anchored and collision calculation.

How long do ragdolls last? Removing them after a certain period will reduce GraphicsPart usage.

If you have any other high stats, I suggest reading this here as CloneTrooper lists what they all mean.

I tried modifying code but it didn’t work, it yielded the same results. Anchoring parts wouldn’t work and I’m pretty sure Humanoids forcibly restrict Cancollide on, so I can’t do that too.

Ragdolls last for two seconds at most, I change the Humanoids state to Enum.HumanoidStateType.GettingUp once ragdolling is complete. It takes an insane amount of memory, any help please? I’m still struggling with this issue.

I’m still struggling on this issue, can anyone please help?

Edit: Used my own ragdoll module yet still yields the same results. I’m not too sure why, i was thinking it could be a memory leak, I quarantined all my scripts but nothing changed.