How to see how much memory script is using

i want to see how much memory each script is causing so i can find the script that has memory leak :frowning:

1 Like

Try using the debug library functions to set the names of sections of memory
debug.setmemorycategory

can u show me a short exaplme of how to implement it

do i just add it to the top of the line of each script in my game?

debug.setmemorycategory("Stuff1")

local stuff = {}
for i = 1, 1000 do
	table.insert(stuff, i)
end

debug.setmemorycategory("Stuff2")
local stuff2 = {}
for i = 1, 1000 do
	table.insert(stuff2, i)
end