Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
OutofMemoryError on Thunderbolt: HttpClient.execute
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nathan  
View profile  
 More options Mar 29 2011, 4:16 pm
From: Nathan <critter...@crittermap.com>
Date: Tue, 29 Mar 2011 13:16:47 -0700 (PDT)
Local: Tues, Mar 29 2011 4:16 pm
Subject: OutofMemoryError on Thunderbolt: HttpClient.execute
I am getting reports of an OutofMemoryError in
AbstractSessionInputBuffer using HttpClient.execute.

Coincidentally, all those who have personally emailed me have the HTC
Thunderbolt.

I've run allocationtracker and stuff, but it has been of limited use
when I can't reproduce the problem.

Yes, I know that a place where you get the OutofMemory isn't
necessarily the cause of the problem. I am looking at everything,
including bitmap allocations. But customer feedback suggests that this
might happen before those other allocations happen, meaning there
could be memory lost in some of these http retrievals.

Here's something I can't explain. I've added a catch(OutOfMemoryError
err) around this spot in my latest version. How am I still getting
errors with the same stack trace? I would think it would start failing
somewhere else.

And has anyone seen anything weird with the HTC Thunderbolt?

Nathan

java.lang.OutOfMemoryError: (Heap Size=16327KB, Allocated=14167KB,
Bitmap Size=7690KB)
at org.apache.http.util.ByteArrayBuffer.<init>(ByteArrayBuffer.java:
53)
at
org.apache.http.impl.io.AbstractSessionInputBuffer.init(AbstractSessionInpu tBuffer.java:
82)
at
org.apache.http.impl.io.SocketInputBuffer.<init>(SocketInputBuffer.java:
93)
at
org.apache.http.impl.SocketHttpClientConnection.createSessionInputBuffer(So cketHttpClientConnection.java:
83)
at
org.apache.http.impl.conn.DefaultClientConnection.createSessionInputBuffer( DefaultClientConnection.java:
170)
at
org.apache.http.impl.SocketHttpClientConnection.bind(SocketHttpClientConnec tion.java:
106)
at
org.apache.http.impl.conn.DefaultClientConnection.openCompleted(DefaultClie ntConnection.java:
129)
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(De faultClientConnectionOperator.java:
173)
at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:
164)
at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConn Adapter.java:
119)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDi rector.java:
348)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.j ava:
555)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.j ava:
487)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.j ava:
465)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Murphy  
View profile  
 More options Mar 29 2011, 4:41 pm
From: Mark Murphy <mmur...@commonsware.com>
Date: Tue, 29 Mar 2011 16:41:35 -0400
Local: Tues, Mar 29 2011 4:41 pm
Subject: Re: [android-developers] OutofMemoryError on Thunderbolt: HttpClient.execute
http://stackoverflow.com/questions/5358014/android-httpclient-oom-on-...

HTC, for unknown reasons, messed up the buffer size. If you set it
yourself, the problem goes away.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://bit.ly/smand1, http://bit.ly/smand2


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan  
View profile  
 More options Mar 29 2011, 5:15 pm
From: Nathan <critter...@crittermap.com>
Date: Tue, 29 Mar 2011 14:15:22 -0700 (PDT)
Local: Tues, Mar 29 2011 5:15 pm
Subject: Re: OutofMemoryError on Thunderbolt: HttpClient.execute

On Mar 29, 1:41 pm, Mark Murphy <mmur...@commonsware.com> wrote:

> http://stackoverflow.com/questions/5358014/android-httpclient-oom-on-...

> HTC, for unknown reasons, messed up the buffer size. If you set it
> yourself, the problem goes away.

That's the problem.

Until I got a recent log, I didn't know how much it was trying to
allocate - 2Megabytes. That seems awfully greedy when you have a 16M
heap - multiple downloads in a row without triggering garbage
collection are sure to bring you down. I'm happy to allocate less
since I'm only downloading 69K files.

Like those in Stack Overflow said, I hope HTC enjoys all the returns.

I guess once in a while, the stack trace from OutOfMemoryError
actually does tell you where the problem is.

Nathan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Murphy  
View profile  
 More options Mar 29 2011, 5:20 pm
From: Mark Murphy <mmur...@commonsware.com>
Date: Tue, 29 Mar 2011 17:20:52 -0400
Local: Tues, Mar 29 2011 5:20 pm
Subject: Re: [android-developers] Re: OutofMemoryError on Thunderbolt: HttpClient.execute

On Tue, Mar 29, 2011 at 5:15 PM, Nathan <critter...@crittermap.com> wrote:
> Until I got a recent log, I didn't know how much it was trying to
> allocate - 2Megabytes. That seems awfully greedy when you have a 16M
> heap - multiple downloads in a row without triggering garbage
> collection are sure to bring you down. I'm happy to allocate less
> since I'm only downloading 69K files.

I think the Thunderbolt should have a larger heap than 16MB -- 24MB
would be my guess.

The problem isn't only the size, but the fact that Android employs a
GC engine that tends to fragment, so while there might be gobs of heap
space, there might not be a 2MB block free. Anything looking to
regularly use large blocks like that should maintain their own pool,
which HttpClient doesn't do (expecting more like the 8K (IIRC)
default).

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://bit.ly/smand1, http://bit.ly/smand2


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan  
View profile  
 More options Mar 29 2011, 5:36 pm
From: Nathan <critter...@crittermap.com>
Date: Tue, 29 Mar 2011 14:36:59 -0700 (PDT)
Local: Tues, Mar 29 2011 5:36 pm
Subject: Re: OutofMemoryError on Thunderbolt: HttpClient.execute
On Mar 29, 2:20 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> On Tue, Mar 29, 2011 at 5:15 PM, Nathan <critter...@crittermap.com> wrote:
> > Until I got a recent log, I didn't know how much it was trying to
> > allocate - 2Megabytes. That seems awfully greedy when you have a 16M
> > heap - multiple downloads in a row without triggering garbage
> > collection are sure to bring you down. I'm happy to allocate less
> > since I'm only downloading 69K files.

> I think the Thunderbolt should have a larger heap than 16MB -- 24MB
> would be my guess.

In practice, my stack traces are showing 16M heap because there is up
to 8Meg of bitmap memory in use. And that is with my bitmaps on a diet
- which was the first thing I did when seeing OutOfMemory errors.

Nathan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan  
View profile  
 More options Apr 2 2011, 2:36 pm
From: Nathan <critter...@crittermap.com>
Date: Sat, 2 Apr 2011 11:36:30 -0700 (PDT)
Local: Sat, Apr 2 2011 2:36 pm
Subject: Re: OutofMemoryError on Thunderbolt: HttpClient.execute
Is there anyway to change the global settings for buffer size?

There are some connections I don't control, such as the dispatch on
Google Analytics.

Nathan

On Mar 29, 2:36 pm, Nathan <critter...@crittermap.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Murphy  
View profile  
 More options Apr 2 2011, 2:50 pm
From: Mark Murphy <mmur...@commonsware.com>
Date: Sat, 2 Apr 2011 14:50:48 -0400
Local: Sat, Apr 2 2011 2:50 pm
Subject: Re: [android-developers] Re: OutofMemoryError on Thunderbolt: HttpClient.execute

On Sat, Apr 2, 2011 at 2:36 PM, Nathan <critter...@crittermap.com> wrote:
> Is there anyway to change the global settings for buffer size?

Rebuild the firmware is the only solution, AFAIK.

> There are some connections I don't control, such as the dispatch on
> Google Analytics.

Oy.

Short of Analytics fixing this in their code, I think you're screwed.
Can you disable your use of Analytics if you're on a Thunderbolt?

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_ Version
1.9.2 Available!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »