I'm working on a game for Android platform, using Java and LibGDX engine.
I've run into an odd issue where FPS in my game drops contantly every 30-40 seconds from 57-60 to 40-45 frames and then gets back. Below are screenshots of logcat output. Garbage Collector is not working at these moments (there is nothing filtered from the log):
I've done some profiling and found out that the problem occurs because of EGLImpl.eglSwapBuffers calls that every 30-40 seconds take more time than usual. On the screenshot below (taken while profiling game menu when nothing happens at all) it takes 3,7ms:
In my rendeing cycle for the menu I just call MyStage.act() and MyStage.draw() which draw a set of ImageButtons - nothing special. My frame render time for the menu (17ms average) also seems too long for such simple rendering, but these stange periodic long buffer swap calls are my main concern now.
By the way if I profile during the gameplay it becomes worse - these EGLImpl.eglSwapBuffers calls take 15ms and more and drop FPS to 30 and keep it there constantly:
I could really use some advice on how to investigate this.