{"id":1221,"date":"2026-11-24T02:04:47","date_gmt":"2026-11-24T02:04:47","guid":{"rendered":"https:\/\/windows-vps.org\/blog\/?p=1221"},"modified":"2026-11-24T02:04:47","modified_gmt":"2026-11-24T02:04:47","slug":"iis-application-pool-recycling-memory-pressure","status":"publish","type":"post","link":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/","title":{"rendered":"IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics"},"content":{"rendered":"<div style=\"padding:20px\">\n<p>An IIS worker process that recycles more than a few times a day is usually trying to tell you something. Recycling destroys the in-process cache, terminates in-flight requests where the fast-fail policy allows it, and drops session state for anything not stored out of process. It looks like a cure for a memory problem and is frequently the cause of the next one. This article covers what actually triggers a recycle under memory pressure, how to distinguish a legitimate memory limit from a leak being papered over, and the diagnostics that identify the leak rather than the symptom. Capacity sizing for the host is covered on <a href=\"https:\/\/windows-vps.org\/\">windows-vps.org<\/a>.<\/p>\n<h2 class=\"wp-block-heading\">The Four Things That Cause an Application Pool to Recycle<\/h2>\n<p>An application pool recycles for exactly four reasons: a scheduled time interval, a private or virtual memory limit, a request or schedule-based condition such as a fixed number of requests served, or an explicit administrator action including a configuration change. Each produces a different Event ID pair in the System and Application logs \u2014 WAS logs Event ID 5074 for the trigger and the worker process logs 1000-series health events. Reading which trigger fired is the first diagnostic step and it tells you whether anyone has a memory problem at all.<\/p>\n<p>The default configuration on a fresh Windows Server install has the periodic time interval set to 1740 minutes, which is 29 hours, and no memory limits. A pool recycling once a day is usually just that default. A pool recycling every twenty minutes is hitting a memory limit, and the question becomes whether the limit is set correctly, whether the application process is balanced across the pool, or whether the code is retaining references it should release.<\/p>\n<h2 class=\"wp-block-heading\">Private Bytes Versus Virtual Bytes<\/h2>\n<p>Private Bytes is committed memory that is not shared \u2014 heap allocations, managed and unmanaged. Virtual Bytes is the size of the private address space including reserved regions, which on a 64-bit process is enormous and almost never the number you want to limit. Setting a Virtual Bytes limit on a 64-bit worker process is one of the most common misconfigurations in IIS: the process reserves address space far beyond what it commits, so the limit trips while the machine still has free RAM, and the recycle happens for no operational reason.<\/p>\n<p>Set Private Bytes as the limit if you must set one, and derive the number from observation rather than from a round figure. Capture the working set at peak traffic over a week, add 30 to 50 percent headroom, and set the limit well above that. The configuration is per pool in applicationHost.config and can be applied without a GUI:<\/p>\n<pre><code>appcmd list apppool \"MyAppPool\" \/text:*\nappcmd set apppool \"MyAppPool\" \/recycling.periodicRestart.privateMemory:1572864\nappcmd set apppool \"MyAppPool\" \/recycling.periodicRestart.time:1.00:00:00\nappcmd set apppool \"MyAppPool\" \/recycling.disallowOverlappingRotation:true<\/code><\/pre>\n<p>Private memory is in kilobytes, so 1572864 is 1.5 GB. The third setting stops two worker processes from co-existing during rotation, which matters under memory pressure: overlapping rotation doubles the pool&#8217;s footprint for the duration of the overlap, and on a 4 GB VPS that is often the difference between a graceful recycle and an out-of-memory event across the host.<\/p>\n<h2 class=\"wp-block-heading\">Reading Memory Pressure From the Counters<\/h2>\n<p>The counters that answer the question are not the ones most dashboards collect. Memory&nbsp;Available&nbsp;MB tells you the host is short. What you want is the trajectory of the worker process itself: Process&nbsp;Private&nbsp;Bytes for w3wp, .NET&nbsp;CLR&nbsp;Memory&nbsp;Heap&nbsp;Size&nbsp;Bytes for the managed heap, and the garbage collection counters that show whether the heap is growing because of live objects or because nothing has promoted yet. A managed heap that climbs monotonically between recycles and drops to a stable baseline at each recycle is a leak. A heap that climbs and falls in a sawtooth within a session is normal generational behaviour.<\/p>\n<p>Get the memory counters that correspond to the pool&#8217;s own metrics so the limit and the observation are in the same units. The performance count on a recycled pool resets, so capture across a full cycle rather than from the last few minutes:<\/p>\n<pre><code>Get-Counter '\\Process(w3wp*)\\Private Bytes' -SampleInterval 10 -MaxSamples 180\nGet-Counter '\\Memory\\Available MBytes','\\Memory\\Pages\/sec' -MaxSamples 30\nGet-WinEvent -LogName System -MaxEvents 500 |\n  Where-Object { $_.Id -in 5074, 5117, 5186 } | Select TimeCreated, Id, Message<\/code><\/pre>\n<p>Pages\/sec above a few hundred sustained on a VPS means the host is paging, and a recycling pool on a paging host will recycle faster each cycle as the working set is evicted. That spiral is the most common memory-pressure failure mode on small instances.<\/p>\n<h2 class=\"wp-block-heading\">Why Recycling Is Not a Leak Fix<\/h2>\n<h2 class=\"wp-block-heading\">Setting the Right Alarm Instead of a Limit<\/h2>\n<p>Once the leak is identified and fixed, the memory limit&#8217;s role changes. Its purpose is no longer to contain normal operation but to bound the damage if the leak returns. Set it with enough headroom that it never fires during legitimate peak load, and add a separate monitoring alarm that triggers at 70 percent of the limit. The alarm gives you a warning, the limit gives you a crash barrier, and the two together mean the pool recovers automatically while you still get a report to act on.<\/p>\n<p>Record the baseline working set after the fix, and re-measure after each application deployment. A release that raises the steady-state footprint by a hundred megabytes is not a bug in itself, but it changes the arithmetic for the limit, and leaving the limit where it was means the next innocent release trips it. The measured baseline is the number that makes the whole configuration defensible.<\/p>\n<h2 class=\"wp-block-heading\">Diagnosing the Leak Properly<\/h2>\n<p>The technique that identifies a managed leak without guesswork is a pair of heap dumps taken an hour or two apart, after the process has been warm for a while. Compare object counts by type rather than total size: the type whose instance count grows monotonically is the one being retained. Static collections, event handler subscriptions that are never removed, and caches keyed by something unbounded \u2014 a per-request identifier, a user-supplied string \u2014 account for the majority of real leaks in line-of-business applications.<\/p>\n<p>Sequence the capture so the comparison is meaningful:<\/p>\n<pre><code>Get-Process w3wp | Select Id, PrivateMemorySize64, StartTime\n&amp; \"$env:ProgramFiles\\IIS Express\\..\\..\\dotnet\" --version 2&gt;$null\n# Prefer dotnet-dump for .NET 5+ or procdump for .NET Framework\nprocdump64.exe -ma -accepteula &lt;w3wp-pid&gt; C:\\dumps\\w3wp_baseline.dmp\n# ... wait 60-90 minutes under normal load ...\nprocdump64.exe -ma -accepteula &lt;w3wp-pid&gt; C:\\dumps\\w3wp_later.dmp<\/code><\/pre>\n<h2 class=\"wp-block-heading\">Configuration Changes That Reduce Pressure Without Recycling<\/h2>\n<p>If the host is genuinely short of memory, the right answer is either more RAM or fewer concurrent worker processes, not a faster recycle schedule. Setting maximumWorkerProcesses above 1 creates a web garden, which multiplies the per-process baseline and makes total memory worse while breaking in-process session affinity. On a VPS with 4 GB or less, keep the pool at one worker process and size the hardware to the peak concurrent request rate.<\/p>\n<p>Two configuration levers help within a fixed memory budget. Enable the IIS output cache for static and semi-static content so repeated requests do not re-execute, and check that the application&#8217;s own caching is bounded \u2014 an unbounded MemoryCache with a sliding expiration and no size limit will consume the pool&#8217;s entire allowance and then hold it.<\/p>\n<p>Review the <a href=\"https:\/\/windows-vps.org\/#plans\">plan specifications<\/a> against your measured peak working set, and treat the memory limit as an alarm rather than a control. A recycle schedule that fires daily by design and never by limit is the target state; anything more frequent is a bug report your application is writing to the event log.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>An IIS worker process that recycles more than a few times a day is usually trying to tell you something. Recycling destroys the in-process cache, terminates in-flight requests where the fast-fail policy allows it, and drops session state for anything not stored out of process. It looks like a cure for a memory problem and &#8230; <a title=\"IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics\" class=\"read-more\" href=\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/\" aria-label=\"Read more about IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1221","post","type-post","status-publish","format-standard","hentry","category-reviews"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics - Windows VPS Blog<\/title>\n<meta name=\"description\" content=\"An IIS worker process that recycles more than a few times a day is usually trying to tell you something. Recycling destroys the in-process cache,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics\" \/>\n<meta property=\"og:description\" content=\"IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics\" \/>\n<meta property=\"og:url\" content=\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/\" \/>\n<meta property=\"og:site_name\" content=\"Windows VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-24T02:04:47+00:00\" \/>\n<meta name=\"author\" content=\"windows-vps\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@myxiechengxuan\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"windows-vps\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/\",\"url\":\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/\",\"name\":\"IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics - Windows VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\"},\"datePublished\":\"2026-11-24T02:04:47+00:00\",\"author\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\"},\"description\":\"An IIS worker process that recycles more than a few times a day is usually trying to tell you something. Recycling destroys the in-process cache,\",\"breadcrumb\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/windows-vps.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\",\"url\":\"https:\/\/windows-vps.org\/blog\/\",\"name\":\"Windows VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/windows-vps.org\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\",\"name\":\"windows-vps\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"caption\":\"windows-vps\"},\"sameAs\":[\"https:\/\/windows-vps.org\/blog\",\"https:\/\/x.com\/myxiechengxuan\"],\"url\":\"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics - Windows VPS Blog","description":"An IIS worker process that recycles more than a few times a day is usually trying to tell you something. Recycling destroys the in-process cache,","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/","og_locale":"en_US","og_type":"article","og_title":"IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics","og_description":"IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics","og_url":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/","og_site_name":"Windows VPS Blog","article_published_time":"2026-11-24T02:04:47+00:00","author":"windows-vps","twitter_card":"summary_large_image","twitter_creator":"@myxiechengxuan","twitter_misc":{"Written by":"windows-vps","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/","url":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/","name":"IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics - Windows VPS Blog","isPartOf":{"@id":"https:\/\/windows-vps.org\/blog\/#website"},"datePublished":"2026-11-24T02:04:47+00:00","author":{"@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58"},"description":"An IIS worker process that recycles more than a few times a day is usually trying to tell you something. Recycling destroys the in-process cache,","breadcrumb":{"@id":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-memory-pressure\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/windows-vps.org\/blog\/"},{"@type":"ListItem","position":2,"name":"IIS Application Pool Recycling Under Memory Pressure: Limits, Leaks, and Diagnostics"}]},{"@type":"WebSite","@id":"https:\/\/windows-vps.org\/blog\/#website","url":"https:\/\/windows-vps.org\/blog\/","name":"Windows VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/windows-vps.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58","name":"windows-vps","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","caption":"windows-vps"},"sameAs":["https:\/\/windows-vps.org\/blog","https:\/\/x.com\/myxiechengxuan"],"url":"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/"}]}},"_links":{"self":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/1221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/comments?post=1221"}],"version-history":[{"count":1,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/1221\/revisions"}],"predecessor-version":[{"id":1222,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/1221\/revisions\/1222"}],"wp:attachment":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/media?parent=1221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/categories?post=1221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/tags?post=1221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}