IIS Recycling and Virtual Memory Limit

What is Recycling in IIS?

When a worker process is recycled, it is terminated and replaced by a new one. This can help:

  • Free up memory leaks or excessive memory usage

  • Reset unstable application states

  • Apply configuration changes without restarting the server

Recycling can happen in various ways:

  • Scheduled recycling (e.g., every 1740 minutes by default)

  • Specific time recycling

  • Request-based recycling (e.g., after a certain number of requests)

  • Memory-based recycling (discussed next)


What is Private Memory Limit?

  • Private Memory Limit defines the maximum amount of private memory (non-shared RAM) a worker process is allowed to use.

  • If the limit is exceeded, IIS recycles the worker process to avoid potential performance degradation or memory exhaustion.

Example: If a site has a memory leak, the private memory keeps growing. When it hits the threshold (e.g., 500 MB), IIS recycles it to release memory.


What is Virtual Memory Limit?

  • Virtual Memory Limit sets a cap on the total virtual memory (including both RAM and page file usage) a worker process can use.

  • If the worker process exceeds this, it’s recycled.

This helps protect the server from apps consuming excessive memory, which could otherwise affect other applications or the whole server.


Key Differences

Metric
Type of Memory
When to Use

Private Memory Limit

RAM (non-shared)

To prevent apps with memory leaks hogging memory

Virtual Memory Limit

RAM + Page File (total VM)

For overall memory usage control


Things to Keep in Mind

  • Frequent recycling can cause performance issues like application pool cold starts.

  • Memory limits should be based on monitoring real-world usage, not arbitrary numbers.

  • Set limits carefully, especially on high-traffic apps.

Last updated

Was this helpful?