So I decided to help a friend of mine solve errors that his scripts had however I realized that the game was giving a lot of lag, so I decided to look at the game’s stats:
And I soon realized where the lag came from, which was the large number of parts that the game has.
Now seeing the memory that the game spends:
As I am not used to solving problems related to the memory of the game, what do I have to do to minimize the memory spent?
The memory usage displated in studio isn’t as accurate as if you were in a published game, since in studio more functionality is happening in the background, so it’s better to test in a published game. If it’s a part count problem, the only solution I can think of is enabling StreamingEnabled.
I have already thought about it, and I will apply it, but otherwise, if there are many errors in the scripts, will this contribute to the increase in memory (this is at least the case with loops)?
That does look like a single error which has to do with a sound asset failing to load. Unless it is massively exhausting sending requests (it looks like it’s doing it multiple times a frame!), it wouldn’t contribute much.
I already discovered the problem there are about 2000 trees (which has many parts) so there is this problem.