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 8275871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:12:28+00:00 2026-06-08T08:12:28+00:00

Not so recently I’ve published a game that is written entirely in Java on

  • 0

Not so recently I’ve published a game that is written entirely in Java on Android platform. Currently I’m trying to get as much of the performance as possible. It seems that the problem in my game’s case is that I’m using more too often ArrayList container in places where Map could be better suited. To explain myself I did it because I was afraid of dynamic memory allocations that would be triggered behind the scene (Map/Tree structures on Android). Maybe there is some sort of structure on Android/Java platform I don’t know about, which will provide me with fast searching results and additionally will not allocate dynamically extra memory when adding new elements?

UPDATE:
For example I’m using an ArrayList structure for holding most of my game’s Particles. Of course removing them independently (not sequentially) is a pain in the b**t as the system needs to iterate through the whole container just to remove one entity object (of course in the worst case scenario).

  • 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-06-08T08:12:29+00:00Added an answer on June 8, 2026 at 8:12 am

    I wouldn’t worry about slowdown because of memory allocation unless you specifically find it to be an issue. Memory allocation isn’t really the cause of slowdowns in Android games, it’s when the GC runs that’s usually the problem. Unless you are inserting and deleting from the Map very often, you might not have to worry about the allocations.

    Update:

    Instead of using a Map, you might want to consider just marking particles as “dead” when you no longer need them and using that flag to skip over them in your update iteration. Store the references to the dead particles in a new deadParticles ArrayList, and just take one out from that list when you need a new one. That way the you have instant access to particles when you need them.

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

Sidebar

Related Questions

Recently I noted that some applications are running on javaw (not in java ).
I recently learned that table valued functions are not allowed with Entity Framework 4.1.
I recently noticed that on my system it is not possible to require 'lib/file.pl'
I recently created my first android live wallpaper and it would not work on
I recently realized that one of my pages does not contain: $(#form1).validate(); call, however
Recently someone pointed out that my personal site was not working on ipad, because
I recently found a DNA Computing Algorithm (not genetic programming or genetic algorithms) that
I recently discovered at work that it is the policy not to use compiler
There were questions on that but not recently and technology must have gone ahead
My team recently decided not to use the trunk branch that is typical of

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.