Re: Windows/Memory: setting HeapOptimizeResources flag

75 views
Skip to first unread message

Kentaro Hara

unread,
Feb 3, 2020, 4:26:33 AM2/3/20
to Richard Townsend, memory-dev, Bruce Dawson, platform-architecture-dev
+memory-dev +Bruce Dawson (who is an expert of Window's memory)



On Sun, Feb 2, 2020 at 8:34 PM Richard Townsend <richard....@arm.com> wrote:
Hi folks (posting on platform-architecture-dev since this seems to be where a lot of base/ people hang out, feel free to forward).

I was looking a little bit at how the low levels of memory allocation works on Windows and I stumbled on a feature (introduced in Windows 8.1) which promises to promises to decommit memory more aggressively and "optimize" each allocation heap's caches (whatever that means). I did a really quick-and-dirty CL of it to see if there was any performance impact and Pinpoint came back with a resounding... maybe (the first time it came back with an incredible +10% improvement in runs per second on Speedometer 1[1], which didn't hold up on the second run, but Speedometer 2 also indicated a slight improvement). The impact on private footprint size is also a bit unclear - the size attributed to malloc increases by 8.7%, but the private footprint increases by only 7% (but I probably am not really running the right combination of stories in Pinpoint to be very representative). Setting the flag does not seem to have any negative effect on Windows 7.

So at the moment I'm thinking about:
  • Whether I should continue running Pinpoint jobs on this (e.g. whether this HeapOptimizeResources flag has been tried before and rejected). 
  • Whether there's an upstream base/allocator OWNER who'd like to look into this a bit further (preferably, anybody who's managed to extract a useful memory number out of Pinpoint). 
I'd also be interested in figuring out where memory consumption currently sits in the priority list versus performance, security, shipping new web platform features etc.

Best
Richard

--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/9a448872-84ed-4332-8994-8bc622867128%40chromium.org.


--
Kentaro Hara, Tokyo, Japan

Nico Weber

unread,
Feb 3, 2020, 8:19:21 AM2/3/20
to Kentaro Hara, Richard Townsend, memory-dev, Bruce Dawson, platform-architecture-dev, Will Harris
Asking on chromium-dev might be better, since you want to reach Windows experts. Maybe someone from Edge has experience with this flag, for example.

We have https://bugs.chromium.org/p/chromium/issues/detail?id=645637 for this, but so far nothing has happened with it.

I don't trust pinpoint's numbers all that much -- maybe you can get more signal by running some experiments locally.

Will Harris

unread,
Feb 3, 2020, 12:28:57 PM2/3/20
to Nico Weber, Kentaro Hara, Richard Townsend, memory-dev, Bruce Dawson, platform-architecture-dev
Maybe put it behind a base::Feature and run an A/B on Canary/Dev - that's probably the best way of gathering real-world data.

Will

Bruce Dawson

unread,
Feb 3, 2020, 1:06:40 PM2/3/20
to Will Harris, Nico Weber, Kentaro Hara, Richard Townsend, memory-dev, platform-architecture-dev
I think Will is correct - real world data is the only way to get a signal.

Note that heap data is (IIRC) only really significant in the browser process. However it can be quite significant. crbug.com/1014701 (spun off of crbug.com/982452) tracks the fact that the heap overhead (fragmentation + metadata + aggressive per-CPU free lists) can make the Windows heap in the browser process have more than 100% overhead. That is, on long-running Chrome browser processes I see that more than half of the heap memory is just overhead.

I've talked to Microsoft about this and they have not committed to anything useful. If this flag works then that would be great.

So, give it a try and monitor the browser-process metrics in particular.
--
Bruce Dawson

Richard Townsend

unread,
Feb 3, 2020, 7:06:22 PM2/3/20
to Bruce Dawson, Will Harris, Nico Weber, Kentaro Hara, memory-dev, platform-architecture-dev
Cool, I’m pleased that the flag seems to be novel. As non-Googler though, I don’t have many powers to run A/B trials etc, and our internal test capacity at the moment is limited (because we’re running pretty much flat out Windows on Arm vs reference unit test suites - hence the interest in trying to use Pinpoint.)

If... I was able to get the CL into a slightly more reasonable state, would you be interested in taking it further, Bruce?

Best
Richard


From: Bruce Dawson <bruce...@google.com>
Sent: Monday, February 3, 2020 6:06:12 PM
To: Will Harris <w...@chromium.org>
Cc: Nico Weber <tha...@chromium.org>; Kentaro Hara <har...@chromium.org>; Richard Townsend <Richard....@arm.com>; memory-dev <memor...@chromium.org>; platform-architecture-dev <platform-arc...@chromium.org>
Subject: Re: Windows/Memory: setting HeapOptimizeResources flag
 
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Bruce Dawson

unread,
Feb 3, 2020, 7:09:50 PM2/3/20
to Richard Townsend, Will Harris, Nico Weber, Kentaro Hara, memory-dev, platform-architecture-dev
Sure. Or, honestly, just file a bug with a description of what you're trying and I'll assign it to me (or someone) and try to get to it.

You received this message because you are subscribed to the Google Groups "memory-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/memory-dev/DB7PR08MB3515BD4EAC54AEF084E9A1F39C030%40DB7PR08MB3515.eurprd08.prod.outlook.com.


--
Bruce Dawson

Reply all
Reply to author
Forward
0 new messages