Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 1.04 KB

lru-memory-consumption.md

File metadata and controls

19 lines (13 loc) · 1.04 KB
title summary component versions reviewed
Avoiding excessive memory consumption
Explains how to avoid excessive memory consumption due to recoverability exception caching
Core
[6, )
2024-09-22

The MSMQ and SQL Server transports cache exceptions in memory to allow transactions to be cleared before executing recoverability policies. Therefore, exceptions with large memory footprints can cause excessive memory consumption. Furthermore, the cache may retain items for longer when the endpoint is scaled out. This page describes how to solve issues caused by excessive memory consumption due to this caching.

Dispose of exception specific resources

An exception may be caught to explicitly dispose of resources before it is rethrown and cached.

For example, disposing the response body contained in a WebException may significantly reduce the amount of memory required to cache the exception:

snippet: dispose-large-exceptions

See pipeline customization documentation for more details.