Since the Dalvik GC is not exact, you will get some spurious
references when scanning the stack, causing otherwise gagbage to stay
alive.
With the introduction of the JIT, is this problem worsen by any rate?
Will the JIT cause more "might have pointers" areas to be scanned,
resulting in more spurious references?
Thanks!
-Ben
> --
> You received this message because you are subscribed to the Google Groups "android-platform" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
>
>
>
>
--
Romain Guy
Android framework engineer
roma...@android.com
Note: please don't send private questions to me, as I don't have time
to provide private support. All such questions should be posted on
public forums, where I and others can see and answer them
Is it possible to switch back to 'non-exact' GC?
Thanks
On Jan 17, 11:14 pm, Romain Guy <romain...@android.com> wrote:
> Didn't we introduce an exact GC in 2.0?
>
>
>
> On Sun, Jan 17, 2010 at 10:58 PM, Ben Cheng <bcch...@android.com> wrote:
> > The current JIT implementation will make sure that all the values kept
> > in CPU registers are flushed to the Dalvik registers when safe points
> > are entered, so the GC will see exactly the same contents in root sets
> > and VM frames regardless whether JIT is enabled or not.
>
> > -Ben
>
> > On Jan 17, 8:32 pm, Tomei <tomei.ninge...@gmail.com> wrote:
> >> Hello,
>
> >> Since the Dalvik GC is not exact, you will get some spurious
> >> references when scanning the stack, causing otherwise gagbage to stay
> >> alive.
>
> >> With the introduction of the JIT, is this problem worsen by any rate?
> >> Will the JIT cause more "might have pointers" areas to be scanned,
> >> resulting in more spurious references?
>
> >> Thanks!
>
> > --
> > You received this message because you are subscribed to the Google Groups "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/android-platform?hl=en.
>
> --
> Romain Guy
> Android framework engineer
dalvik/vm/Thread.c:
pMap = dvmGetExpandedRegisterMap(nonConstMethod);
if (pMap != NULL) {
/* found map, get registers for this address */
This scans only registers that are known to be pointers.
Thanks to everyone who replied!
It's turned on for builds produced by (or made in close collaboration
with) the Android team for devices with a sufficiently large system
partition. In particular, it is enabled on all builds we've worked on
for the Droid and N1. Depending on vintage, it *might* be enabled in
builds made for the HTC Magic. And it is definitely *off* in builds
made for the Dream (aka the G1).
> Is it possible to switch back to 'non-exact' GC?
Yes. The vm has command-line switches "-Xgc:precise" or
"-Xgc:noprecise". I don't know off-hand how those end up getting
plumbed into the system, but as they say, grep is your friend.
-dan
FWIW, two additional notes:
(1) This is type-precise GC, not live-precise GC. Good enough to
avoid a conservative scan, but can still be improved.
(2) Register maps (the Dalvik equivalent of "stack maps") increase the
size of optimized DEX files by about 9% on average. Devices with very
tight storage constraints may not want to use them, so the GC still
needs to handle conservative roots.
Register maps are generated during verification. If we can't verify a
class ahead of time with dexopt, the map will be generated on first
use.
switching topic slightly ...
Just out of curiosity -- what classes cannot be verified at dexopt
time? I see some verification messages at run time if I have a class
with linkage errors (calling methods that don't exist). Is this the
only case verification need to run at run-time?
Why can such linkage errors be marked "permanently bad" during dexopt
time (to avoid run-time verification)?
Thanks