Came across today when I was trying to find some memory leaks in my game. In the video below, you can see I have many cars lined up. Please note that these are only car models, and there are no scripts in them. There are 0 scripts in the workspace; just the models are in the workspace. Then, you can see I clone the car folder two times. Lastly, I destroy all the folders containing the cars.
The UntrackedMemory value spikes after deletion of these folders, and never goes back down. I’ve been on the plate for a few minutes, and it never showed any sign of returning to normal. Garbage collection works near instantly, if not instantly, so it should go back down as soon as I destroy them.
At first, it seemed like a garbage collection-related memory leak since it was under “Untracked”. However, 0 scripts are referencing the cars (as I mentioned before, it is only the car models in the workspace; there are absolutely 0 scripts in the workspace). The only script that gets close to it is the main script I show at the beginning and end of the video. However, I cleared the reference to the folders in the loop after destroying them, and there is nothing in LuauHeap to signify otherwise as well.
I believe the spike becomes larger when there are welds and scripts inside the vehicles as well. To limit any variables, though, I destroyed them, so it’s just the car model being tested.
Video:
Here is a testing plate so you can test yourself. The car models in this plate are just toolbox models, instead of the ones in the video, but they produce the same result as the video.
UntrackedMemory Testing.rbxl (2.6 MB)