Open Bug 1640950 Opened 6 years ago Updated 6 years ago

Annotate more dom arena related stat to crash reports

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement

Tracking

()

People

(Reporter: sefeng211, Unassigned)

Details

Currently, when a crash happens with dom arena allocation, we only record the size of allocation. Ideally, we should annotate more data.

  1. The size of the arena
  2. The size of the chunk that we tried to allocate. This happens when we request a small amount of memory, but the allocator ends up requesting a large chunk of memory.
  3. Some stats from jemalloc arena?

My concern is there seem to be a weirdly high number of these OOM crashes where we're allocating node infos, but I haven't investigated to see if they are actually that common. If we have a situation where somebody has a ton of different web pages open in a single process, then they might be getting a lot of arena fragmentation. The crashes I've seen don't look like they are low on memory or address space, so it is hard to know what might be going on.

So I'd like to propose something like this

For the stats of the arena, given the arena id, we can report the arena_stats_t object, so this gives us the information about the size of the arena.

To get the actual size that we tried to allocate, can we report an error message at https://searchfox.org/mozilla-central/rev/7dafc35406b9c945189c617d427f5458933fd3fb/memory/build/mozjemalloc.cpp#2432-2434 to indicate that we failed to create a new chunk?

Thoughts Andrew?

Flags: needinfo?(continuation)

(In reply to Sean Feng [:sefeng] from comment #0)

Currently, when a crash happens with dom arena allocation, we only record the size of allocation. Ideally, we should annotate more data.

  1. The size of the arena

How do you expect this to help?

  1. The size of the chunk that we tried to allocate. This happens when we request a small amount of memory, but the allocator ends up requesting a large chunk of memory.

If a chunk was attempted to be allocated, its size is pretty much deterministic, and can be derived from the allocation size. It's always going to be 1M for allocations < 1M - 8K, and a multiple of 1M for larger ones.

  1. Some stats from jemalloc arena?

Again, how do you expect this to help?

Good to know that the size is deterministic.

I was thinking of cases like https://crash-stats.mozilla.org/report/index/0c57cb55-9b92-4ab3-baf5-2a41c0200522#tab-details, which doesn't have any hints to what happened as everything looked fine. If we can gather some stats about the arena, we might be able to find a pattern here?

I'm not entirely sure what information would be good. I think it would mostly be nice if we could somehow get a sense if the DOM allocator is experiencing extreme fragmentation.

Flags: needinfo?(continuation)
Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.