I’m running an older version of JME… and I have heavily instrumented it to notify me of frame spikes and spit out the app state that caused them. I generally do not see random frame spikes and can always attribute them to one of my app states.
Caveats:
my JME is 3.6 before it was released “sometime”
I run at 60 FPS
most of my watchdogs only trigger after 50 ms.
Note: I also generally consider ‘float’ tpf to be a bit garbage and never use it for anything. So all of my timings are based on System.nanoTime() and so wouldn’t reflect any issues with float-based TPF or how JME tracks time.
I do recommend you switch to a System.nanoTime() per update to see if that aligns with what you see.
Also, have you enabled the detailed profiler to see where the time goes?
I used NanoTime in my code. I stripped it down as much i could to have most basic test case.
That’s the frame time graph i recorded. The interval seems to not total random:
JVisualVM might show a slight increase in cpu usage. I say might, because the bump i so little i am not 100% sure. Rather interestingly the frame after the spike makes up for the time mostly. Unfortunately this increases the problem if you are using classical movement*tpf code.
I tried with jm3 3.5.1, 3.6 and 3.6.1. Result are similar.
Are you using vsync on or having JME control the frame rate with sleeps? (Just trying to make sure the picture is complete… theoretically, either way can cause catch-up frames.)
Windows 10. Microsoft says my pc is too old for Win11.
I played with the windows graphics settings, “Hardware accelerated GPU scheduling and variable refresh rate”
Enabled both.
. and the spikes are smaller now.