hello
im trying to make anti cheat for my game
i found Stats().InstanceCount which i found helpful since it detects when something is added in the core gui ( GetTotalMemoryUsageMb also works but when player changes graphics it might give a false positive)
i noticed that small actions like jumping or hitting esc walking and even moving the camera adds instances
here is an example of the jumping one
im scared it might give a false positive if used in my game
Most of these are just things that roblox runs in the background, such as CoreScripts, UI, Events, Etc.
After a while, they are eventually garbage collected and removed from memory, which is assuming they have no references, or are completely dead.
The amount will vary depending on how much items you have in the game., for me the amount of items I have when looking at it is over 500K+, but thats likely due to me being in studio, as when in the client, its usually around 30K - 40K.
Not entirely sure as to why its a high number (though I know for certain that game contains roughly 5000 Instances in it), but it might be due to all the services doing something.