How to think like a garbage collector in lua? (I'm serious)

Hi there. :wave:
I need help learning garbage collection aka saving memory.
So that there would not be anything superfluous in memory and precious kilobytes were not wasted, after some time the place was working.

I’m having difficulty understanding how the garbage collector cleans up tables.

The only thing I know is:

“Tables whose keys are instance references will not be deleted.”

Please, if you know of any other such subtleties, please write to me. :pray:

Have you already tried reading Hexcede’s brilliant article?