New issue
Advanced search Search tips

Issue 752704 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Blocking:
issue 740209



Sign in to add a comment

Reduce memory cost of a service worker

Project Member Reported by chrishtr@chromium.org, Aug 5 2017

Issue description

On the Maps PWA, the memory breakdown for the service worker
v8 isolate (measured on my Mac, but should be similar to for Android):

peak_size: 3,237.2 KiB
code_space: 1,328.6 KiB total, 1,264.6 KiB used
map_space: 177.3 KiB total, 160.3 KiB used
new_space: 434.6 KiB total, 417.6 KiB used
old_space: 1,646.0 KiB total, 1,603.5 KiB used

Most of the code_space and map_space here is actually v8 builtins. Will
comment with measurements of that.
 
An empty service worker has memory use something like this:

allocated_objects_size total: 1,871.0 KiB
code_space: 1,236.6 KiB total, 1,188.6 KiB used
map_space: 65.3 KiB total, 8.3KiB used
new_space: 89.9 KiB total, 72.9 KiB used
old_space; 578.1 KiB total, 561.1 KiB used

I'm guessing a bit because the memory-infra tracing view does not
distinguish clearly which isolate is which. I took the one with
smaller numbers in it.

This seems to indicate that a service worker requires at least 1MB.

Also, to compare apples to apples, I should replace "peak_size" in the first
comment with "allocated_objects_size total" which is 3446 KiB, similar to the original number.

Comment 2 by ojan@chromium.org, May 8 2018

Cc: -ojan@chromium.org

Sign in to add a comment