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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:25:09+00:00 2026-06-15T19:25:09+00:00

I have an app which uses an osmdroid mapactivity. Every time the screen orientation

  • 0

I have an app which uses an osmdroid mapactivity.

Every time the screen orientation the heap size grows and after a couple of orientation changes I get the following errors:

12-12 00:53:08.990: E/dalvikvm-heap(6712): Out of memory on a 262160-byte allocation.
12-12 00:53:08.990: I/dalvikvm(6712): "filesystem" prio=5 tid=46 RUNNABLE
12-12 00:53:08.990: I/dalvikvm(6712):   | group="main" sCount=0 dsCount=0 obj=0x43057e08 self=0x571583c8
12-12 00:53:08.990: I/dalvikvm(6712):   | sysTid=8674 nice=0 sched=0/0 cgrp=apps handle=1487255264
12-12 00:53:08.990: I/dalvikvm(6712):   | schedstat=( 298265664 165380214 301 ) utm=25 stm=4 core=0
12-12 00:53:08.990: I/dalvikvm(6712):   at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
12-12 00:53:08.995: I/dalvikvm(6712):   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:650)
12-12 00:53:08.995: I/dalvikvm(6712):   at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:389)
12-12 00:53:08.995: I/dalvikvm(6712):   at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:449)
12-12 00:53:08.995: I/dalvikvm(6712):   at org.osmdroid.tileprovider.tilesource.BitmapTileSourceBase.getDrawable(BitmapTileSourceBase.java:93)
12-12 00:53:08.995: I/dalvikvm(6712):   at org.osmdroid.tileprovider.modules.MapTileFilesystemProvider$TileLoader.loadTile(MapTileFilesystemProvider.java:142)
12-12 00:53:08.995: I/dalvikvm(6712):   at org.osmdroid.tileprovider.modules.MapTileModuleProviderBase$TileLoader.run(MapTileModuleProviderBase.java:241)
12-12 00:53:08.995: I/dalvikvm(6712):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
12-12 00:53:08.995: I/dalvikvm(6712):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
12-12 00:53:08.995: I/dalvikvm(6712):   at java.lang.Thread.run(Thread.java:856)
12-12 00:53:09.020: I/dalvikvm-heap(6712): Clamp target GC heap from 64.436MB to 64.000MB
12-12 00:53:09.050: I/dalvikvm-heap(6712): Forcing collection of SoftReferences for 262160-byte allocation
12-12 00:53:09.095: I/dalvikvm-heap(6712): Clamp target GC heap from 64.436MB to 64.000MB

I have an Activity which holds two fragments and both of those fragments extend one abstract fragment which initialises the MapActivity.

I have read quite a few posts from other people with the same problem. I ended up implementing the following in the abstract Fragment:

    @Override
    public void onDestroyView() {
        super.onDestroyView();

        unbindDrawables(con.findViewById(R.id.main_layout));
        System.gc();
    }

    private void unbindDrawables(View view) {
        if (view.getBackground() != null) {
            view.getBackground().setCallback(null);
        }
        if (view instanceof ViewGroup) {
            for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
                unbindDrawables(((ViewGroup) view).getChildAt(i));
            }
            ((ViewGroup) view).removeAllViews();
        }
    }

Here is my onCreateView which initialises con:

@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        con = container;
        return inflater.inflate(R.layout.main_fragment,container, false);
    }

I am not sure what else I can do.

can anyone help me solve this?

Thanks

  • 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-15T19:25:10+00:00Added an answer on June 15, 2026 at 7:25 pm

    Try handling the screen rotation yourself, add the following code into the activity

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
    }
    

    and add the following into your activity tag in your manifest file

    android:configChanges=”orientation|keyboardHidden|screenSize”

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

Sidebar

Related Questions

I have an Android app which uses Jackson parser for JSON parsing. After I've
I have a Ruby app which uses readline with command completion. After the first
I have an app which uses a keyboard hook procedure in a library. The
I have implemented an App which uses SQLite database, now if I run the
I have made an app which uses DropBox SDK for iPhone to connect to
I have a Django app which uses LDAP as the authentication backend. I'm not
I have a Silverlight web app which uses ASP.net Website administration tool for user
I have made a layout for my app which uses a lot of activities.
I have a Rails 3.1.3 app which uses devise for users authentication and soft-deletes
I have finished the development of my app which uses Google Maps. During the

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.