Windows Intermittent FPS drops


Hi Guys,

I havent posted in a while, I hope this is in the right place. I am having a really tricky issue with my game project and i just cant seem to work out why. I have really tried to solve this on my own before posting here, but no luck.

So my game keeps getting intermittent fps drops to about 45fps, from the usual solid 60fps. The drop lasts only about a second, if that, then the game immediately returns to 60fps. These drops occur approximately every 30-60 seconds.

Some details:
-I am using gms2
-game is set to 60fps in gms2 options
-I have tried sleep margin anywhere from 1-20ms, makes no difference.
-graphics options are set at as follows:
(the large texture page is required in the game design sadly, and switching vsync etc makes no difference, in fact, no combination of options there really seems to work)
-I am prefetching in VRAM on game launch, literally everything, which equates to about 260mb (the issue occurs with or without prefetching, i just really though prefetching would solve this)
-CPU Usage in task manager doesnt show any major load issues
-I have tried many combinations of texture groups, and preloaded some or all of them, the result is always the same
-texture group settings look like this:
(different border sizes has made no difference)
-It does this on both machines I have tried this on, one is a very high end gaming rig 2080ti etc... other is 2015 imac with windows 10.
-when investigating with the profiler I cannot see any object that could be causing this... everything is averaging below 1ms call time.

The drops are really methodical, as in the always happen, and they last only a second, but it absolutely destroys gameplay so I need to find a way to fix it.

I am so so stumped, I would be really grateful if anyone could help me work out what is going on.


šŸ§ *penguin noises*
GMC Elder
everything is averaging below 1ms call time.
Looking at averages when the game runs just fine 98.3% of the time isn't going to help. If you could profile right when you get a lag spike (which should be possible if it's as predictable as you're saying) you might get more useful results.
You need to use the profiler in debugger to see what is going on and if you have some internal object causing the issue. The profiler will give you a general idea of what kind of performance different objects have, though it doesn't always lead to a clear answer.
Have you tried the function show_debug_overlay(true).

It *might* give you a starting point as it draws a bar at the top of the screen indicating CPU/GPU load among other things. A spike in one or the other when the FPS drops would tell you what the CPU decrease is being caused by.

The other thing it sounds like is possibly garbage collection. Do you create a lot of temporary arrays in your project? Perhaps if there is a whole bunch of them, when GMS is cleaning up the memory it might affect frame rate for a second. I'm not sure how/when arrays are freed from memory after no longer in use, so this is just a guess.