#Help with memory optimization

1 messages · Page 1 of 1 (latest)

lone mountain
#

im working on a game recently but i notice that the longer player play the game , the higher the memory get so how do it fix that ?

final dove
#

local part = Instance.new("Part")
part.Parent = workspace
-- later in the game
part:Destroy()
This destroys unused objechts

digital belfryBOT
#

studio** You are now Level 3! **studio

final dove
#

local connection = part.Touched:Connect(function(hit)
print("Something touched me")
end)

-- later
connection:Disconnect()

#

It disconnects event listeners

#

table.remove(myTable, index)
This cleans up table

#

while true do
task.wait(1)
print("Still running safely")
end
And this controls loops

#

I hope this will help you