Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
frequent garbage collection
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
  5 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
 
bnovc  
View profile  
 More options Oct 22 2009, 4:29 pm
From: bnovc <m.bn...@gmail.com>
Date: Thu, 22 Oct 2009 13:29:21 -0700 (PDT)
Local: Thurs, Oct 22 2009 4:29 pm
Subject: frequent garbage collection
Are patterns of GC like this expected?

D/dalvikvm( 1095): GC freed 271 objects / 10328 bytes in 473ms
D/dalvikvm( 1095): GC freed 37 objects / 1632 bytes in 100ms
D/dalvikvm( 1095): GC freed 2 objects / 48 bytes in 56ms

This is opening on an almost empty application (just a TextView) and
those all happen within milliseconsd when it is opened.

This doesn't consistently happen, but I've seen it from time to time.

Wouldn't it be better to only do one pass?


 
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.
fadden  
View profile  
 More options Oct 23 2009, 2:00 pm
From: fadden <fad...@android.com>
Date: Fri, 23 Oct 2009 11:00:22 -0700 (PDT)
Local: Fri, Oct 23 2009 2:00 pm
Subject: Re: frequent garbage collection
On Oct 22, 1:29 pm, bnovc <m.bn...@gmail.com> wrote:

> Are patterns of GC like this expected?

> D/dalvikvm( 1095): GC freed 271 objects / 10328 bytes in 473ms
> D/dalvikvm( 1095): GC freed 37 objects / 1632 bytes in 100ms
> D/dalvikvm( 1095): GC freed 2 objects / 48 bytes in 56ms

> This is opening on an almost empty application (just a TextView) and
> those all happen within milliseconsd when it is opened.

If you "adb logcat -v time" you can see the timestamps associated with
the log messages.

This sort of behavior is usually associated with explicit calls to
System.gc(), unless your application is right up against the memory
limit and the VM has no choice but to GC constantly.


 
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.
Barry Hayes  
View profile  
 More options Oct 23 2009, 2:40 pm
From: Barry Hayes <bha...@gmail.com>
Date: Fri, 23 Oct 2009 11:40:30 -0700
Local: Fri, Oct 23 2009 2:40 pm
Subject: Re: frequent garbage collection
Yeah, I think the answer to "expected" is "yes."
"What you want" might be some other answer ..

Where in particular are you seeing this?

--
bhayes yat cs dot stanford dot edu is what you should put in your
contact files -- it'll forward to me no matter where I move

 
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.
bnovc  
View profile  
 More options Oct 29 2009, 5:39 pm
From: bnovc <m.bn...@gmail.com>
Date: Thu, 29 Oct 2009 14:39:51 -0700 (PDT)
Local: Thurs, Oct 29 2009 5:39 pm
Subject: Re: frequent garbage collection
I am seeing it when opening applications mostly. I have quite a bit of
free memory when I am doing it.

Here is a slightly different example, where multiple processes are
being GCed when one starts up:

10-29 16:11:33.060 D/dalvikvm( 1502): GC freed 50 objects / 1864 bytes
in 590ms
10-29 16:11:33.080 D/dalvikvm( 1824): GC freed 1014 objects / 85152
bytes in 697ms
10-29 16:11:33.090 D/dalvikvm( 1789): GC freed 228 objects / 9544
bytes in 535ms
10-29 16:11:33.130 D/dalvikvm( 1265): GC freed 200 objects / 10184
bytes in 739ms
10-29 16:11:33.140 D/dalvikvm( 1319): GC freed 78 objects / 3224 bytes
in 647ms
10-29 16:11:33.160 D/dalvikvm( 1395): GC freed 736 objects / 54048
bytes in 747ms
10-29 16:11:33.160 D/dalvikvm( 1486): GC freed 103 objects / 4952
bytes in 706ms
10-29 16:11:33.180 D/dalvikvm( 1299): GC freed 35 objects / 1216 bytes
in 746ms
10-29 16:11:33.230 D/dalvikvm( 1208): GC freed 11498 objects / 827320
bytes in 689ms

which vastly increases the bootup time of the application.

I suppose I'll add some backtraces to the "GC freed" area and see what
is invoking all of these when I get time.

Thanks for the information.

(Sorry for the delayed response)

On Oct 23, 1:40 pm, Barry Hayes <bha...@gmail.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.
fadden  
View profile  
 More options Oct 29 2009, 8:49 pm
From: fadden <fad...@android.com>
Date: Thu, 29 Oct 2009 17:49:37 -0700 (PDT)
Local: Thurs, Oct 29 2009 8:49 pm
Subject: Re: frequent garbage collection
On Oct 29, 2:39 pm, bnovc <m.bn...@gmail.com> wrote:
> Here is a slightly different example, where multiple processes are
> being GCed when one starts up:

> 10-29 16:11:33.060 D/dalvikvm( 1502): GC freed 50 objects / 1864 bytes
> in 590ms
> 10-29 16:11:33.080 D/dalvikvm( 1824): GC freed 1014 objects / 85152
> bytes in 697ms

[...]

There is some code in system_server that causes periodic GCs of apps
-- has to do with management of objects whose lifetime depends on
objects in other processes -- but it's usually pretty good about
distributing the GCs over time.  Having 9 different processes GC all
at once is unexpected.  The number and size of objects collected
reinforces the idea that this was an explicit GC rather than one
forced by allocations.

> I suppose I'll add some backtraces to the "GC freed" area and see what
> is invoking all of these when I get time.

If you're tinkering with stuff in the sources, a stack trace from
Runtime.gc() might be easier to manage.  If you can make this happen
reliably, connect a debugger to one of the background apps and set a
breakpoint there.  That way you don't have to fiddle with the sources
at all.

 
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 »