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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:30:41+00:00 2026-05-23T15:30:41+00:00

When I zoom in/zoom out from time to time in my map activity I

  • 0

When I zoom in/zoom out from time to time in my map activity I get in console an “OutOfMemory error:bitmap size exceeds VM budget”. The app doesn’t crash on my developement phone, but I’m not sure If this issue won’t cause a problem in future.

Note: I display maximum 30 custom markers on map.

The error stack doesn’t reference my code. Does anyone have a fix or a best practice to get rid of this error?

Thanks in advance.

public void onCreate(Bundle savedInstanceState) { 
...
marker = getResources().getDrawable(R.drawable.marker);
...
fillData();
}
public void fillData() {
...
  for (int i = 0; i < lats.length; i++) {
    ...
    map.getOverlays().add(new ContactOverlay(marker, tempLat, tempLon, names[i],
                phones[i]));
   }
}

private class ContactOverlay extends ItemizedOverlay<OverlayItem> {
    private List<OverlayItem> items = new ArrayList<OverlayItem>();

    public ContactOverlay(Drawable marker, double latitude,
            double longitude, String title, String snippet) {
        super(marker);
        boundCenterBottom(marker); 
        items.add(new OverlayItem(getPoint(longitude, latitude), title,
                snippet)); 
        populate();
    }

    @Override
    protected OverlayItem createItem(int i) {
        return (items.get(i));
    }
    ...
 }
  • 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-23T15:30:42+00:00Added an answer on May 23, 2026 at 3:30 pm

    Try to reuse the bitmap and the canvas where you draw. Each time when you redraw the overlay, a new bitmap is allocated.

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

Sidebar

Related Questions

I am calling AsyncTask on zoom-in and zoom-out of google map after zoom-in or
I am showing POI's List on google map as:- 1- User Zoom-In or Zoom-Out
I am trying to add some functionality that will zoom the map in/out depending
I wrote this code for zoom in/out . it works but even with one
I wrote this code for zoom in / out and it suppesed to only
Is there an easy way to disable zoom in/out feature for XYPlot which is
I want to add functionality for the zoom in/out image that display by the
I have a subview inside a uiscrollview. Then I zoom it out. So it
I'm trying to make a level-of-detail line chart, where the user can zoom in/out
you all know: right click -> zoom in or out in flash file, well,

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.