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
Garbage Collection options on Android
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
  2 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
 
Shalay  
View profile  
 More options Oct 10 2012, 1:43 pm
From: Shalay <sha...@appmobi.com>
Date: Wed, 10 Oct 2012 10:43:27 -0700 (PDT)
Local: Wed, Oct 10 2012 1:43 pm
Subject: Garbage Collection options on Android

Hello,

We're running a game engine natively on Android using v8.  It works fine,
except that garbage collection causes periodic hesitations (pauses) in
display.  I'm using the AddGCPrologueCallback() & AddGCEpilogueCallback()
to log the gc.  The Scavenge type gc does not cause a problem, only the
MarkSweepCompact type.
The way it happens depends on the number of active entities in the game.  
With few entities we get MSC type GC every minute or so, and no visible
hesitation.  But with high number of entities, MSC happens every 4-5
seconds, and visually estimating, it looks like pause periods of
100-300mS.  Are there any options to change GC behavior to avoid this
problem?  I've tried " --max-new-space-size=1024 --never-compact" flags
based on suggestion by Erik Cory in this stack overflow question<http://stackoverflow.com/questions/5603011/node-js-and-v8-garbage-col...>,
but it still behaves the same.  

Thanks for your help.

------------

Some more info:

I'm measuring the period between Prologue and Epilogue callbacks to see how
long GC takes.  Not sure if this is a good way of measuring or not.  For
some reason with low entity numbers, where there's no visible hesitation,
the GC time measures 30-100 mS.  But with high entity numbers, where the
pause is noticable, the GC time measures about 17 mS.

I'm using V8 version 3.9.21.

Below, I've pasted some GC log info through setting "--trace-gc-verbose
--trace-gc".

10-10 00:27:34.140: INFO/v8(32656): ?D??
6351031365587755522057220257292374326212763523190095872.0 -> -0.0 MB,
10-10 00:27:34.140: INFO/v8(32656): 1263571892 ms.
10-10 00:27:34.140: INFO/v8(32656): Memory allocator,   used: 1263571876,
available: -2118013160
10-10 00:27:34.140: INFO/v8(32656): New space,          used: 1263571876,
available: -2118013160
10-10 00:27:34.140: INFO/v8(32656): Old pointers,       used: 1263571876,
available: -2118013160, waste: 1263571876
10-10 00:27:34.140: INFO/v8(32656): Old data space,     used: 1263571876,
available: -2118013160, waste: 1263571876
10-10 00:27:34.140: INFO/v8(32656): Code space,         used: 1263571876,
available: -2118013160, waste: 1263571876
10-10 00:27:34.140: INFO/v8(32656): Map space,          used: 1263571876,
available: -2118013160, waste: 1263571876
10-10 00:27:34.140: INFO/v8(32656): Cell space,         used: 1263571876,
available: -2118013160, waste: 1263571876
10-10 00:27:34.140: INFO/v8(32656): Large object space, used: 1263571892,
available: -2118498744
10-10 00:27:34.320: INFO/v8(32656): ?D??
6350937828500622873889477860090764425384320345802014720.0 -> -0.0 MB,
10-10 00:27:34.320: INFO/v8(32656): 1263571876 ms.
10-10 00:27:34.320: INFO/v8(32656): Memory allocator,   used: 1263571860,
available: -2118013160
10-10 00:27:34.320: INFO/v8(32656): New space,          used: 1263571860,
available: -2118013160
10-10 00:27:34.320: INFO/v8(32656): Old pointers,       used: 1263571860,
available: -2118013160, waste: 1263571860
10-10 00:27:34.320: INFO/v8(32656): Old data space,     used: 1263571860,
available: -2118013160, waste: 1263571860
10-10 00:27:34.320: INFO/v8(32656): Code space,         used: 1263571860,
available: -2118013160, waste: 1263571860
10-10 00:27:34.320: INFO/v8(32656): Map space,          used: 1263571860,
available: -2118013160, waste: 1263571860
10-10 00:27:34.320: INFO/v8(32656): Cell space,         used: 1263571860,
available: -2118013160, waste: 1263571860
10-10 00:27:34.320: INFO/v8(32656): Large object space, used: 1263571876,
available: -2118498744


 
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.
Shalay  
View profile  
 More options Oct 22 2012, 2:05 pm
From: Shalay <sha...@appmobi.com>
Date: Mon, 22 Oct 2012 11:05:15 -0700 (PDT)
Local: Mon, Oct 22 2012 2:05 pm
Subject: Re: Garbage Collection options on Android

An update on this for anybody who might have a similar issue and find this
post:

The GC problems observed were actually happening with an older version of
V8.  Switching to version 3.9.21 fixed the issues, and in this version --max-new-space-size=1024
--never-compact  actually work and make a difference.  Thanks V8 team.


 
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 »