Azure / Azure/azure-functions-host
Queue Trigger Function occupying memory and not releasing even in idle state in AKS POD
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 36
Description
Following the recent deployment of our Azure Queue Trigger Function within AKS, we’ve observed that memory consumption continues to increase even when the pod is in an idle state (i.e., not actively processing messages). Notably, the memory is not being released over time, leading to sustained high usage.
Upon analyzing memory dumps from the affected pods, we identified that the primary objects consuming memory are:
System.Threading.TimerQueue
Microsoft.Azure.WebJobs.Utility+d__24
These objects are typically associated with internal polling mechanisms used by the Azure WebJobs SDK, particularly for managing background listeners and retry logic.
Below are the objects which we can see in memory dumps:
AsyncStateMachineBoxd__53>
AsyncStateMachineBoxd__24>
DelayPromiseWithCancellation
TimerQueue
Currently we are disposing the unused memory after every 5 mins but the above objects are getting release.
any help or suggestion is appreciated. Thank You!
Contributor guide
Research direction
Start with the reported memory dumps from the Azure Queue Trigger Function running in an AKS pod, focusing on System.Threading.TimerQueue, Microsoft.Azure.WebJobs.Utility.d__24, and the listed AsyncStateMachineBox objects. Compare memory behavior while the pod is idle and after the reported five-minute disposal cycle. Done means the retention behavior is explained and the idle-state memory issue is reproducibly confirmed or resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100