Try reading this.
TL;DR: Luau does garbage collection. Automatically. It depends on a few things, like scope, and whether or not a thread is alive.
- Things like
wait()will prevent a threat from terminating until the thread finishes waiting. - Scope is important: exiting a level of scope will mean that garbage collection can occur to memory in that scope.
Unreadable memory is (to my knowledge) impossible.