Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6703939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:13:51+00:00 2026-05-26T07:13:51+00:00

I am developer of Android game. I have create an GLSurfaceView and draw something

  • 0

I am developer of Android game.

I have create an GLSurfaceView and draw something in OnDrawFrame(GL10 gl)
like below

    void OnDrawFrame(GL10 gl)
    {
         frame_limit_wait();
         game_logic();
         draw_game();
    }

Everything is good, but onething is strange, when drawing n-frame(Occur at GC_EXPLICIT/paused 92ms) will cause game a bit pause, in appplication it’s ok, but not in a smooth game.

Original game I was use SurfaceView and Thread update works and smooth.

If add a line below draw_game() like ‘system.gc()’ it seems work but I feel a bit slow.
Compare to another game engine, my game endinge is running slow.

How to resolve the latency problem ?

Edit : I have solved the issue.
Just initial native Float Buffer once, and use put and position(0) to modify the Buffer content.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:13:52+00:00Added an answer on May 26, 2026 at 7:13 am

    The garbage collector is running and holding up your frame. I would recommend taking a close look at the code that executes in the functions frame_limit_wait(), game_logic(), and draw_game() and do everything possible to prevent initializing new objects.

    The most common techniques for this include:

    • use fields instead of local variables
    • use for(int i; i < x; i++) instead of for(variable : list)
    • making sure no extra processing is done while drawing frames.

    If that still doesn’t work then you can try offloading some processing to a separate thread or consider using the NDK and writing native code. With C++ you don’t have to worry about the GC at all. However both of these methods will complicate your code quite a bit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a new game developer and have started developing game for android. I
I am following this tutorial https://developer.android.com/guide/tutorials/views/hello-tabwidget.html and have completed it. Now I would actually
I know how to create and apply styles and themes thanks to http://developer.android.com/guide/topics/ui/themes.html .
Is there something in the Android developer guidelines that disuades developers from providing the
I have a been working on a game for Android and debugging it on
I'm developing an android app, and have developed a game, but I now have
I'm trying to create a memory game. I've looked at the Android tutorials for
I am a beginner Android developer and I am trying to make a game
We create non-game programs that run on mobile devices; iPhones, Windows Mobile, Android, Palm
I'm developing simple traffic educational game like https://market.android.com/details?id=cz.allianz.krizovatky.android . When the player taps on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.