New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 866098 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Consider using TCMalloc on macOS

Project Member Reported by erikc...@chromium.org, Jul 20

Issue description

We currently use libMalloc on macOS. We might see performance improvements if we move to TCMalloc.

I'm going to roughly divide performance into three buckets:
1) speed of allocation/free/etc.
2) total memory overhead, during quiescence
3) fragmentation

I have not investigated (1) or (3). 

For (2):
libMalloc uses three zones: large, small and tiny. The large zone uses a free list of max size = [total machine memory] / 1024. Running the command:

"""
ps aux | grep Canary | awk '{print $2}' | xargs -I '{}' sudo vmmap '{}' | grep "MALLOC.*(empty).*see MALLOC"
"""

shows that for my ~16 tabs across 2 profiles [with some extensions], there are ~40 processes with ~300MB of dirty memory in the freelists, primarily for the large zones. This is on a machine with 64GB memory. I expect this number to roughly scale with # of processes.

If we used TCMalloc or any custom implementation, we could add optimizations for background processes [e.g. purge free lists]. This would be in line with purge-and-suspend, and other such optimizations.

Not sure if this is worthwhile though, especially since we don't know how a custom allocator would change (1) or (3).
 
+1 to experimenting the idea :)

Status: Untriaged (was: Available)
Available, but no owner or component? Please find a component, as no one will ever find this without one.
Components: Internals
Status: Available (was: Untriaged)

Sign in to add a comment