CFanのBlog

A good day for snow-viewing

Windows 11 runs out of committed memory: Wcmsvc leaks kernel ALPC messages on every DHCPv6 retry, and the source is an old router

No comments on Windows 11 runs out of committed memory: Wcmsvc leaks kernel ALPC messages on every DHCPv6 retry, and the source is an old router
86 views

Translated from the Chinese original by Claude.

My PC had been on for a week when a local build of a front-end project failed with ‘memory allocation failed’. Task Manager showed 55 GB committed against a limit of just 56.5 GB, yet the processes added up to only about 36 GB, all of them the programs I always have open. The remaining ten-odd GB was in the kernel: the paged pool was over 10 GB, and two pool tags alone, AlMs and AlEB, accounted for 7.3 GB, with about 6.75 million allocations each, and they were still growing every second.

It took several days and quite a few detours, but in the end a kernel pool allocation trace with call stacks found it: the memory was being leaked by the Windows Connection Manager (Wcmsvc). For every client request it handles, it sends a few ‘Sleep Study’ messages over ALPC to the Power Dependency Coordinator in the kernel, and once sent, those messages are never freed. What set it off was DHCPv6: an old router on the LAN, used as an access point, was sending router advertisements with the M flag but had no addresses to give out, so the Windows DHCPv6 client started a new request every 3–6 seconds, endlessly, leaking about 20 messages each round.

Once I turned off IPv6 router advertisements and the DHCPv6 service on that AP, the leak stopped at once, dropping from 4–7 messages a second to about 0.1. Memory that has already leaked can only be reclaimed by rebooting. Below is a record of how I tracked it down.

How this leak happenedThe old router sends router advertisements with the M flag but answers NoAddrsAvail; the Windows DHCPv6 client starts over every 3 seconds, and every round makes Wcmsvc send synchronous ALPC requests through umpdc.dll to the Power Dependency Coordinator in the kernel; the request messages (AlMs) and their extension buffers (AlEB) stay in the paged pool, never freed. Turning off router advertisements and DHCPv6 on the old router stops the leakHow this leak happenedThe arrows repeat every 3 seconds; the memory in the red box only ever grows.Old router (used as an AP)LEDE 17.01, no IPv6 upstreamRA has M flag: ask DHCPv6 for an addressbut DHCPv6 replies NoAddrsAvail (none)Windows DHCPv6 clientDrops Advertise with no address (correct)but no backoff: starts over every 3 sEvery round calls WcmsvcuserRAAdvertiseClient request begin/endWcmsvc (Conn. Manager)SleepStudy::IndicateClientRequest…Adds / removes a Sleep Study blocker ref.Sends sync ALPC requests via umpdc.dlluserPower Dep. Coord. (pdc.sys)Receives requests, replies normallybut nobody frees the request messagekernelALPCreply!Leak: piling up in the paged poolEach request leaves 1 ALPC message (AlMs) and 1 extension buffer (AlEB), about 1.1 KB in all.About 20 a round, 4–7 a second, ~0.5 GB a day. Restarting Wcmsvc won’t free them; only rebooting will.Fix: turn off RA, DHCPv6 and the NDP proxy on the old router’s LANWithout the M flag, DHCPv6 stops retrying; the leak falls from 4–7 a second to about 0.1.
The whole chain: the old router keeps DHCPv6 retrying non-stop, and every round makes Wcmsvc leak about 20 kernel messages.

Environment

ItemDetails
OSWindows 11 Pro 26H2, build 26300.9818, x64 (not an Insider build)
Memory32 GB of RAM + a 26 GB page file, commit limit 56.5 GB
The PC’s networkWired and Wi-Fi both connected to the same LAN at once
LANA MikroTik as the main router; a router running OpenWrt 25.12 as an AP, with IPv6 in relay mode; and a very old router flashed with LEDE 17.01, also used as an AP

Background

First, a quick introduction to a few concepts that come up later. If you already know them, feel free to skip ahead.

Memory in Windows

  • Commit charge and commit limit. When a program asks for memory, Windows first ‘promises’ that the memory can definitely be provided, and the total of these promises is the committed memory, or commit charge (‘Committed’ in Task Manager). The ceiling on promises is roughly the size of physical memory plus the page file. Once it is reached, new requests fail, even if there is still free physical memory. That is why this time it was ‘memory allocation failed’ rather than just the machine slowing down.
    Reference: Introduction to the page file
  • Paged pool and non-paged pool. Memory the kernel and drivers use for themselves is allocated from two ‘pools’: the contents of the paged pool can be moved out to the page file when memory is tight, while the non-paged pool must stay in physical memory at all times. Both count towards the commit charge, and Task Manager shows their totals under Performance → Memory. Normally each is a few hundred MB.
    Reference: Memory Pools
  • Pool tags. Every allocation the kernel makes from a pool carries a 4-character tag saying who allocated it and what for, such as AlMs. The system keeps a count of allocations, frees and bytes in use for each tag, and that table is what poolmon shows. A tag that only ever goes up is a clue to a leak.
    References: PoolMon – Overview, ExAllocatePool2
  • svchost (Service Host). Many Windows system services have no exe of their own and run inside svchost.exe instead. A -s Wcmsvc on the command line means this svchost runs just the one service, Wcmsvc, so per-process figures map straight onto the service.
    Reference: Service host grouping in Windows 10

ALPC and Sleep Study

  • ALPC (Advanced Local Procedure Call) is a local messaging channel provided by the Windows kernel. A server opens a port, and clients connect to it and send messages; a synchronous request waits until the server sends a reply. Local RPC, COM and the like are mostly built on top of it, and processes also use it to talk to kernel components. Each message takes up a block of paged pool in the kernel (tag AlMs, for ALPC message), and any extra data the message carries goes in an extension buffer (tag AlEB). Normally both blocks should be freed once a request is over. Microsoft has not published programming documentation for ALPC; the most complete description is in chapter 8 (System mechanisms) of ‘Windows Internals’, 7th edition, Part 2.
    Reference: ALPC class (ETW events)
  • Wcmsvc (Windows Connection Manager) manages the PC’s network connections, for example whether to drop Wi-Fi once a wired connection is up, and tells other components about the state of the network connections. Services such as the DHCP Client and the firewall call it, and these calls are the ‘client requests’ that come up later.
    Reference: Windows Connection Manager
  • Sleep Study is the Windows feature that records ‘what kept the computer from entering a low-power state’. The report generated by powercfg /sleepstudy comes from it, and it is mainly meant for laptops that support Modern Standby. When a component starts some work, it registers a reference on a ‘blocker’ with the kernel’s Power Dependency Coordinator (PDC), and dereferences it once the work is done. PDC’s driver is pdc.sys; user-mode services do this by sending it ALPC messages through umpdc.dll (User Mode Power Dependency Coordinator).
    Reference: Modern standby SleepStudy
  • Modern Standby (S0 Low Power Idle) is a phone-style standby that ‘stays online while asleep’; traditional desktops usually support only S3 sleep.
    Reference: Modern Standby

Tracing tools

  • ETW (Event Tracing for Windows) is the event tracing mechanism built into Windows. The kernel and individual components (providers) can emit events at any time, such as ‘allocated a block of pool memory’, ‘sent an ALPC message’ or ‘DHCPv6 sent a Solicit’; normally, unless a trace session subscribes to them, nothing is recorded.
    Reference: About Event Tracing
  • WPR (Windows Performance Recorder) is the built-in wpr.exe. It subscribes to ETW events according to a recording profile (.wprp) and writes them to an .etl file. You can ask it to record a call stack (stack walk) with every event, that is, the addresses of the functions in the chain of calls that led to that point. logman is an older command that does the same kind of thing. An .etl file can be opened in WPA (Windows Performance Analyzer), or converted to CSV with tracerpt so you can do the counting yourself.
    References: Windows Performance Recorder, Authoring Recording Profiles, logman, tracerpt
  • Symbols: a call stack contains only addresses, and to know which function each one belongs to you need the PDB symbol file for that exact version. For Microsoft’s system files, the symbols can be downloaded from the Microsoft public symbol server, and dbghelp in the debugging tools fetches them automatically.
    Reference: Microsoft Public Symbol Server
  • pktmon (Packet Monitor) is the packet capture tool built into Windows. There is no need to install Npcap, and its capture files can be converted to pcapng for Wireshark.
    Reference: Packet Monitor (Pktmon)

Where IPv6 addresses come from

  • Router advertisement (RA). On an IPv6 network, routers regularly send out router advertisements, telling computers the network prefix, the default router, and how they should get an address. An advertisement has two flags: M (Managed address configuration) means ‘ask a DHCPv6 server for an address’, and O (Other configuration) means ‘get other configuration, such as DNS, from DHCPv6’.
    Reference: RFC 4861 §4.2 Router Advertisement Message Format
  • SLAAC (Stateless Address Autoconfiguration) and DHCPv6 (Dynamic Host Configuration Protocol for IPv6). If an advertisement carries a prefix and allows autoconfiguration, a computer can generate an address from the prefix by itself (SLAAC); if the M flag is set, the computer will also ask a DHCPv6 server for an address (stateful). A network can have both at once.
    References: RFC 4862 IPv6 Stateless Address Autoconfiguration, RFC 8415 DHCPv6
  • The DHCPv6 four-message exchange (Solicit / Advertise / Request / Reply). The computer first sends out a Solicit to find servers, a server answers with an Advertise, the computer then sends a Request, and the server confirms with a Reply. Addresses go in the IA_NA (Identity Association for Non-temporary Addresses) option; when the server has no address to give, it puts a Status Code of NoAddrsAvail (2) in there instead. The client should ignore an Advertise like that, with no address in it.
    References: RFC 8415 §18.2.1 Solicit, §18.2.9 Receipt of Advertise Messages, §21.13 Status Code Option
  • Retransmission and SOL_MAX_RT. Under RFC 8415, a Solicit that gets no result has to be sent again, with the interval starting at 1 second (SOL_TIMEOUT) and doubling each time, up to SOL_MAX_RT (3600 seconds by default); a server can lower that ceiling with option 82 (the SOL_MAX_RT option), to 60 seconds for example. That way, even if an address never comes, after a while the client is only trying once a minute or once an hour.
    References: RFC 8415 §15 Reliability of Client-Initiated Message Exchanges, §7.6 Transmission and Retransmission Parameters, §21.24 SOL_MAX_RT Option
  • OpenWrt’s odhcpd handles router advertisements, DHCPv6 and the NDP proxy (NDP being the Neighbor Discovery Protocol) on the LAN. Each of these can be set to server (act as the server itself), relay (pass on what comes from upstream), hybrid (relay if there is something upstream, otherwise act as the server) or disabled.
    References: OpenWrt: odhcpd, odhcpd README

Symptoms

  • After 7 days and 23 hours of uptime, 55 GB / 56.5 GB committed; the build failed with memory allocation failed, and the System log had event 2004 from Resource-Exhaustion-Detector (low virtual memory).
  • The commit sizes of the processes on the Details tab of Task Manager added up to about 36 GB, and none of the processes looked abnormal.
  • The paged pool under Performance → Memory was over 10 GB, when it is normally only a few hundred MB.

To see what is in the paged pool, you can use poolmon from the WDK (poolmon /b sorts by bytes). I read it by calling NtQuerySystemInformation (SystemPoolTagInformation) directly, with the same result:

Pool tagLive allocationsSizeWhat it is
AlMsabout 6.75 million5.56 GBALPC messages
AlEBabout 6.75 million1.75 GBExtension buffers of ALPC messages

Both tags belong to ntoskrnl itself and can’t be found by searching the drivers folder, so this was not a third-party driver. ALPC is the local RPC channel Windows uses for communication between processes, and between processes and the kernel. The two tags had almost exactly the same counts, which meant every leaked message carried an extension buffer. In other words, something was sending messages non-stop and they were never being freed. At the time the count was rising by 4–17 a second, which averages out to about 0.5 GB a day.

Dead ends: Dell software, SearchHost, restarting services

  • Dell’s software. I looked at handle counts first: Dell Peripheral Manager (the tray app DPM.exe) was clutching over 50,000 process handles, keeping more than 350 processes that had already exited from being freed, which looked very suspicious. But with Dell’s services and DPM all stopped, AlMs still rose by 12.6 a second (14.3 before). DPM’s handle leak is a separate problem with nothing to do with this one.
  • A suspended SearchHost. After a fair bit of searching, the closest match I found was a March 2025 post on Microsoft Japan’s technical support blog: Explorer sends ALPC messages to SearchHost.exe when it creates and destroys windows, and while SearchHost is suspended the messages pile up as AlMs, to be freed as soon as you open the Start menu or Search once. I wrote a script to log AlMs and the suspended state of a few UWP host processes every 2 seconds: SearchHost was running the whole time, ShellExperienceHost was woken twice, and AlMs didn’t go down at all. Not that, then.
  • Restarting both ends. I captured another trace that put ALPC send and receive events together with pool allocations, and the ones holding on to the messages seemed to be Wcmsvc, Explorer and TextInputHost. So I restarted Wcmsvc, TextInputHost, Explorer and ctfmon one by one, and AlMs didn’t go down by a single one. So the messages outlived both the senders and the receivers: this was a leak in the kernel.
  • Sandboxie. With its service stopped for 10 hours, the rate was just the same.

Don’t experiment on core networking services. After I restarted Wcmsvc, all HTTPS traffic hung, and in the end I had to reboot the PC. Restarting services can’t free memory that has already leaked anyway; if you want the memory back, simply rebooting is less hassle.

Capturing a pool allocation trace with call stacks

What actually did the job was WPR (Windows Performance Recorder): it can record allocations and frees for just the pool tags you name, with a call stack attached to every allocation. A custom profile, alpc-stacks.wprp:

Record for 90 seconds from a Command Prompt running as administrator, then convert it to CSV:

The PoolAllocation / PoolFree events in the CSV carry pool addresses, so pairing them up by address tells you which allocations were still not freed when the trace ended. Each allocation is followed immediately by a StackWalk event holding the raw addresses of the call stack; the module base addresses from the Image events turn these into ‘module + offset’, and dbghelp, with symbols fetched from Microsoft’s symbol server, resolves them into function names. You can look at all this in WPA too; I wrote a script to do the counting.

The result was remarkably clean: in 91 seconds AlEB was allocated 10,081 times in total, and the 570 still not freed at the end all came from the svchost that hosts Wcmsvc (svchost.exe -k LocalServiceNetworkRestricted -p -s Wcmsvc), along only two call paths: between them, those two paths allocated 572 times and freed only twice. One of them:

The other is the same path, except that it goes through SleepStudy::IndicateClientRequestEnd → umpdc!SleepstudyHelperBlockerActiveDereference instead; the two account for roughly half each.

In other words, at the start and at the end of every client request, Wcmsvc sends a synchronous ALPC request through umpdc.dll to the Power Dependency Coordinator (a component in the kernel), adding or removing a reference on a ‘Sleep Study’ blocker. The request goes out and the reply comes back, but the request message (AlMs) and its 272-byte extension buffer (AlEB) are never freed: about 1.1 KB each time. The receiving end is in the kernel, which is why restarting Wcmsvc doesn’t free them either.

Some supporting evidence:

  • Just before memory filled up for the second time (92 hours after boot), there were 2,067,779 AlMs and 2,062,769 AlEB, almost exactly equal: the whole leak is this one path.
  • The audio service calls the same umpdc functions, and its messages are freed 0.01–0.04 ms later; components such as DHCPv6 and Terminal Services call a different umpdc send function, and theirs are freed normally too. Only these two calls in Wcmsvc leak, and they leak practically every message.
  • This PC doesn’t even support Modern Standby (powercfg /a lists only S3 and hibernation), yet Wcmsvc still does Sleep Study bookkeeping for every request.

Who is sending Wcmsvc requests

The leak came in bursts: about 10 a second for a few seconds, then a pause of a second or two. Among the clients calling Wcmsvc in the trace, the calls from the DHCP Client service (Dhcp) had exactly the same rhythm. At first I suspected it was down to having both wired and Wi-Fi connected to the same network, but I turned Wi-Fi off and tested for a few minutes, and the rate didn’t change.

Next I recorded 60 seconds of the DHCPv6 client’s ETW events, reading the number of live AlEB once a second at the same time, and lined the two up by time. In that minute, the DHCPv6 client logged these events on the wired adapter (count of each kind):

Plotting the increase in AlEB each second together with the times DHCPv6 started a new request (event 51005):

After each new DHCPv6 request, AlEB rises for two secondsIn 60 seconds the DHCPv6 client started 20 new rounds of requests; after each one, AlEB grew by about 10 in each of the next two seconds, 400 in allAfter each new DHCPv6 request, AlEB rises for two secondsIn the 60 seconds 23:34:00–23:35:00 UTC on 28 November 2026, DHCPv6 started over 20 times,and unfreed AlEB grew by 400: exactly 20 per round.New AlEB per secondDHCPv6 starts a new round (event 51005)0510One round ≈ 3 s: +10, +10, 00 s10 s20 s30 s40 s50 s60 sSeconds from 23:34:00
The orange triangles mark when DHCPv6 started a new round; the blue bars are the AlEB added each second.

One round every 3 seconds: DHCPv6 starts a new request, AlEB rises for the next two seconds, about 20 per round, and not a single round missing in the whole 60 seconds. There is no such loop on the Wi-Fi side, which is why turning Wi-Fi off made no difference.

You won’t see this loop in Event Viewer. These events aren’t in the DHCPv6 client’s Admin log, and its Operational log is off by default, so you have to record ETW directly with logman (which needs administrator rights).

Is the router sending the wrong thing, or is it Windows?

I captured 20 seconds of DHCPv6 packets with pktmon, which comes with Windows (no need to install Npcap), and converted them to pcapng to look at in Wireshark:

Every packet gets captured twice (by different components of the network adapter); with the duplicates removed, it looks like this:

Time (s)MessageTransaction IDNotes
1.61Solicit0xa39803
1.61Advertise0xa39803Status code in the IA_NA is NoAddrsAvail (2)
2.62Solicit0xa39803Sent again once, 1 second later
2.62Advertise0xa39803As above
7.64Solicit0x225673New transaction ID, starting all over again
13.66Solicit0x78f640Another round

The router’s Advertise is well formed: the transaction ID and client ID are both echoed back unchanged, there is a server ID, DNS, and SOL_MAX_RT (option 82) = 60 seconds, plus an IA_NA containing the status code NoAddrsAvail, meaning ‘I have no address for you’. So both sides are at fault:

  • The router’s configuration contradicts itself: its router advertisements set the M flag (‘ask a DHCPv6 server for an address’), yet its DHCPv6 server hasn’t a single address to hand out.
  • Windows doesn’t back off: under RFC 8415, the client is right to ignore an Advertise like this with no address in it (section 18.2.9), but the Solicit retransmission interval should start at 1 second and keep doubling up to SOL_MAX_RT; and even when it discards the Advertise, the client must still act on the SOL_MAX_RT in it (sections 18.2.1 and 21.24). What Windows does instead is send once more after 1 second, then start a fresh round every 3–6 seconds, for ever.
Windows sent 58 Solicits in 60 s; by RFC 8415 it should have sent 6In the same minute Windows sent 58 Solicits; with RFC 8415 backoff, starting at 1 second and doubling up to a cap of 60 seconds, it should have sent only 6Windows sent 58 Solicits in 60 s; by RFC 8415 it should have sent 6Actual: event 51006 (Solicit sent) in the same minute. Expected: first timeout 1 s, doubling each time,capped at the server’s SOL_MAX_RT (60 s here); the ±10% random jitter is not drawn.Windows actual58×Per RFC 84156×0 s10 s20 s30 s40 s50 s60 sSeconds from 23:34:00
The Solicits Windows actually sent in the same minute, and when they should have gone out with RFC 8415 backoff.

On its own this would just mean a few extra DHCPv6 packets every few seconds, nothing to worry about; except that every round makes Wcmsvc leak about 20 kernel messages.

Which device was sending them

My first suspect was the OpenWrt 25.12 AP, but IPv6 on its LAN is in relay mode (ra, dhcpv6 and ndp are all relay, and DHCP for IPv4 is set to ignore too), so it wouldn’t answer with an Advertise of its own. Going by the source MAC of the Advertise in the capture, the one sending it was the old router: LEDE 17.01 firmware from 2018, used as an AP, with no IPv6 upstream, yet with IPv6 services still switched on in its LAN DHCP settings (only the relevant lines shown):

ra_management '1' puts the M flag in the router advertisements, and ra_default '1' makes the router announce itself as the default router even though it has no public IPv6 of its own. With no prefix to hand out, all odhcpd can do is answer every Solicit with NoAddrsAvail.

The fix: turn off IPv6 services on that AP

In the old router’s LuCI, go to Network → Interfaces → LAN → Edit → DHCP Server → IPv6 Settings, set ‘Router Advertisement-Service’, ‘DHCPv6-Service’ and ‘NDP-Proxy’ all to ‘disabled’, then Save & Apply. I made the change in the web interface; from the command line it would be roughly:

The leak stopped as soon as the change was made. In the minute after the change, AlEB went from 30,143 to 30,142: not a single one more. Checking again 13 hours later, it averaged about 0.1 a second (it used to be 4–7), roughly 10 MB a day, which can safely be left alone. The 30,000-odd that had already leaked (30-something MB) won’t be freed until the next reboot.

If you can’t touch the router, you can instead turn off DHCPv6 for just that adapter on the PC:

I haven’t actually tried this PC-side method myself. Once DHCPv6 is off, the adapter no longer asks DHCPv6 servers for addresses and DNS; addresses autoconfigured by SLAAC are not affected. If the IPv6 addresses on your network are handed out by DHCPv6 in the first place, don’t make this change.

The problem on the Windows side is still there. Wcmsvc leaks messages on every client request; it’s just that nothing is setting it off non-stop any more. If a similar device turns up on the network again, or some other service calls Wcmsvc often, it will go on leaking.

If you’ve run into this too

  • If the paged pool under Performance → Memory in Task Manager keeps growing, poolmon /b shows AlMs and AlEB at the top with similar counts, and restarting services doesn’t bring them down, this may be the problem.
  • Record 60 seconds of DHCPv6 events with the logman commands above; if 51005 and 51062 turn up every few seconds, DHCPv6 is retrying endlessly.
  • Capture packets and look at the source MAC of the Advertise to find the device on your LAN that sends router advertisements with the M flag but can’t hand out addresses, then turn off its IPv6 router advertisements and DHCPv6, or give it a proper prefix. Take particular care when an old router is turned into an AP: it often still has its own IPv6 services switched on.
  • Memory that has already leaked can only be reclaimed by rebooting.

Leave a comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.