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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:17:20+00:00 2026-05-19T23:17:20+00:00

I have an application which upon start request around 10-12KB of data from server

  • 0

I have an application which upon start request around 10-12KB of data from server (in onResume, I have a thread which starts to get data from server) and then paints it in tabular form on the view. Each row of view consist of 5 TextViews and 2 Drawables.

Now, the application works perfectly fine on 2.2 and previous version of OS, but crashes on 2.3.2 with out of memory error in onCreate method (while setting the layout from R.main).
The way to recreate the error is to keep on rotating the device (around 20-25 times), so that app keeps on switching from portrait to landscape mode.
I looked at the DDMS output and I see a pattern. If I switch between portrait and landscape mode pretty fast … system tries to run GC… showing messages such as

02-09 12:20:08.617: DEBUG/dalvikvm(109): GC_EXPLICIT freed 426K, 47% free 6201K/11655K, external 4752K/5934K, paused 122ms

But just before crashing it prints out lot of GC messages

02-09 12:20:12.875: DEBUG/dalvikvm(184): GC_EXTERNAL_ALLOC freed 112K, 52% free 3022K/6215K, external 5127K/5136K, paused 110ms 02-09 12:20:12.933: DEBUG/dalvikvm(28163): GC_EXTERNAL_ALLOC freed 108K, 34% free 7894K/11847K, external 20252K/20560K, paused 155ms 02-09 12:20:13.007: INFO/dalvikvm-heap(28163): Clamp target GC heap from 32.031MB to
32.000MB 02-09 12:20:13.007: DEBUG/dalvikvm(28163): GC_FOR_MALLOC freed 2K, 34% free 7891K/11847K, external 20254K/20560K, paused 47ms 02-09 12:20:13.074: DEBUG/dalvikvm(28163): GC_EXTERNAL_ALLOC freed 0K, 34% free ....

more such lines. and then crash.

I’m unable to understand why it crashes in one OS and not other. My device is a Samsung Nexus S. Any ideas? I ran the MAT tool on the Heap dump and I see 5-6 instances of main activity class all with some retained memory. Sshouldn’t the memory be garbage collected?

  • 1 1 Answer
  • 1 View
  • 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-19T23:17:20+00:00Added an answer on May 19, 2026 at 11:17 pm

    I see 5-6 instances of main activity class…

    You are leaking Activities. Do your worker threads keep references to Activities (or Contexts or View-derived types) by any chance?

    I strongly urge you to read Retaining an Object During a Configuration Change in the SDK. It tells you exactly what you need to change.

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

Sidebar

Related Questions

I have a backbone application which, upon load, needs to fetch data from four
I have an application which receives a broadcast from the AlarmManager . Upon this,
I have an application which logs in into a webservice. I start a new
I have an application which is receiving data for thousands (say 50,000) subjects. Each
I have a application which handles picture chosen from gallery. But there is a
In my iPad app, I have a UIAlertView which pops up upon start up,
I have a wizard in my asp.net MVC application which is built upon this
I have recently put together a JWS application which gets it's argument from a
I have a Delphi application which spawns 6 anonymous threads upon some TTimer.OnTimer event.
I have application which uses Sherlock ActionBar package. The application uses platform-specific behavior for

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.