On 2013/10/11 05:59:32, loislo wrote:
On 2013/10/10 18:54:39, Hannes Payer wrote:
> I would propose to turn off allocation folding when you turn on object
tracking
> and vice versa. FLAG_use_allocation_folding = false
> Doing that will give you all the objects with corresponding sizes.

If the flag doesn't change the sizes or count of the objects in the heap we
will
use it.
Otherwise that trick will give us the results that doesn't reflect the real
'allocations picture' for the page.

The flag does not change the size and objects that get allocated. It may just
result
in more memory fragmentation when folding is turned on. For example,
new A()
if (condition)
new B()
else
new C()
Folding will allocate A+B+C together but will later at runtime only use A+B or
A+C. B or C will be fragmentation, there will not be an objects at that
location,
just free space filler memory.

I guess it is fine to turn it off.




>
> https://codereview.chromium.org/22852024/diff/84001/src/heap.cc
> File src/heap.cc (right):
>
> https://codereview.chromium.org/22852024/diff/84001/src/heap.cc#newcode4979
> src/heap.cc:4979: HeapProfiler* profiler = isolate()->heap_profiler();
> On 2013/10/03 16:27:55, Alexandra Mikhaylova wrote:
> > On 2013/10/02 18:20:04, Hannes Payer wrote:
> > > On 2013/10/02 18:00:29, Hannes Payer wrote:
> > > > Why do you track the allocation of the memento separately? And why
don't
> you
> > > > account the allocation in the if branch before?
> > > Ok, ignore question two, because you allocate using AllocateRaw. But why
do
> > you
> > > track the memento separately?
> >
> > The memento is treated as a separate HeapObject when the heap is being
> iterated,
> > so if we don't track it, we'll have untracked allocations.
>
> OK. You could also ignore the mementos since they are VM specific and never
> visible to the user. Mementos allocated in optimized code are allocated
together
> with their parent object, so you cannot track them. They are manually folded
> into the parent object.

It doesn't matter that memento couldn't be accessible from js.

If memento is an object (from GC point of view i.e. could be moved or
collected)
then AllocationProfiler has to track it as a separate allocation.

The scenario:
1) enable allocation tracking
2) take heap snapshot,
3) do some action that allocates memento together with an object
4) take another snapshot
5) compare the snapshots
6) select memento object in the diff

Expected result:
we show the time and js callstack of the allocation point for this memento
object.

OK, fine.

https://codereview.chromium.org/22852024/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to