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

  • Home
  • SEARCH
  • 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 4607710
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:44:29+00:00 2026-05-22T00:44:29+00:00

I am building an application for the android Phone and am experiencing some strange

  • 0

I am building an application for the android Phone and am experiencing some strange ‘throttling’. I believe it is because a semaphore is being called to halt whatever the application is doing to process something else within the phone. Though I’m not positive.

I am curious of if there would be a way to spread these breaks out or something else to make it less visible to the users that the application is having little lag spikes so-to-speak.

Edit: some further information, what I am currently running with is a 2d array of images – only about 80 are drawn at a time of the instanced ~8000. They only draw if their colour tint is not RGB0(pitch black). A runtime loop in the update checks what images are closest to the player and gives them a basic minimal lighting of RGB 0.2f. Other than that basic event handlers and movement/view-port loops are in the update. Note that I’m using Libgdx framework, not android native. So OpenGL etc etc

Edit: I’d like to note that the problem isn’t what you’d think it would be. I was sending a vector2 about 3800 times a render – but not just ‘sending’ one, but declaring new Vector2 and sending parameters that way. THE GARBAGE COLLECTOR WOULD NOT TOLERATE THIS ATROCITY. Runs smoothly now that I’m sending just 2 floats. My bad ._.

  • 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-22T00:44:30+00:00Added an answer on May 22, 2026 at 12:44 am

    Unless there are several active processes running at the same time, this should not happen.

    My guess (without seeing the code) is that the garbage collector is kicking in too much. Are you initializing objects in a loop? If so, can you reuse the objects instead?

    Objects may be anything, specially Views. Make sure you reuse your Views and not create new ones.

    Another point to consider is full layout redrawing: can you redraw just a portion of the screen instead of all of it? (i.e., use view.invalidate(rect); as opposed to view.invalidate();)

    Lastly, are your layouts too deep? Try to make them as flat as you can. For example, use RelativeLayout instead of nested LinearLayouts.

    Take some time an watch this video: Romain Guy’s Google I/O 2009 talk. Lots of information to get from there.

    After the update, I see that you have 8K images to draw. If you instantiate all of them most probably there is not much room in the memory for anything else, so the GC will need to continuously collect anything it can. That means, slowing down the whole system. Check out, on the same video, the Q&A at about 53-55 min. He proposes, in situations like yours, to have all the references to bitmaps in a HashMap of soft references, so the GC can collect the unused images when needed. That would prevent collecting anything else.
    I would also instantiate them in batches as needed instead of doing it all at the beginning.

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

Sidebar

Related Questions

I am building application that required some data from iPhone's Call log(read only). The
I'm building an application in C# using WPF. How can I bind to some
I'm building a web application targeting mobile devices (specifically iPhone and Android). I'm building
So I'm building an android application, I want the users to be able to
I am building an android application which queries a database for a bus number,
I'm building an android application and I have a pretty dumb question - I've
I am building an android application , that will plot a list of addresses
I am building an android application that reads text files. Now,i have multiple text
When building an application, is there any meaningful difference between the idea of Find
I'm building an application that is targeting Windows, Mac and Linux soon. I was

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.