Hi Joe,
We have been doing some experiments with V8 that would allow us to get
a better picture of JS heap allocations over time. It is at the very
early stage though.
I'm wondering why you decided to optimize allocations to help GC. Did
you see long pauses on the DevTools Timeline? Do the application's
memory grows rapidly and kicks GC too often?
On Thu, Jul 4, 2013 at 12:02 PM, <
joh...@grob.org> wrote:
> Hi
>
> I'm working on a large JavaScript application and would like to reduce the
> number of memory allocations/disposals to make the GC's life easier. I'm
> specifically worried that we have a few locations in inner loops that
> dominate the memory turnaround.
Do they allocate objects that persist in the memory or just some
short-living ones? In the latter case V8's GC should do pretty good
job and be really fast no matter how much garbage was created.
> Is there any way that the DevTools could help me identifying them?
>
Yes. You can run your application with Timeline recording on and see
how often GCs occur and how long it takes. You can also try "Record
Heap Allocations" on the Profiles panel that captures heap state 10
times per second and draws allocations graph which changes over time
when the old objects are collected. It forces GC though, so the graph
may be different from what actually happens in your app when it is not
being inspected.
> Ideally, I think I would like to record the call stack every time a new
> object is created, and then create statistics about which function created
> how many objects within a given time frame.
We don't have such tool at the moment.
> The size of the objects doesn't
> matter too much in this process, as I'm not trying to bring down the overall
> memory usage in this case.
>
Hmm, why do you want to optimize the number of allocations? If all
allocated objects are small and the heap doesn't grow much they
shouldn't trigger GCs too often. Also can you describe what kind of
application you work on and what you optimize for (e.g. are you trying
to achieve 60fps rendering speed and avoid dropped frames)?
> Cheers,
> Joe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Chrome Developer Tools" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
google-chrome-develo...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>
Yury