help request: memory leakage problem in Apisix GW
- Dominant language
- Lua
- Stars
- 17.1k
- Forks
- 2.9k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 63
Description
### Description
**Current behavior**:
After running stress tests, memory usage increases and doesn’t decrease after the tests are finished (unlike CPU usage, which decreases as expected). The configured resources are:
resources:
limits:
cpu: 2000m
memory: 5Gi
requests:
cpu: 1500m
memory: 4Gi
The minimum replicas are set to 1, and the maximum replicas are set to 3. The plugins in use are proxy-rewrite, serverless-pre-function, loki-logger, and prometheus.
Any idea what could be causing this? Why isn’t memory being “cleaned” after the traffic load is gone?

**Expected behavior:** Memory usage should decrease after the traffic load is gone, similar to how CPU usage decreases.
### Environment
- APISIX version: 3.9.1-debian
- Operating system (run `uname -a`):
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`): nginx version: openresty/1.25.3.1
Contributor guide
Research direction
Start by reproducing the stress test against APISIX 3.9.1-debian with the listed resource limits, replica settings, and plugins. Compare memory behavior before, during, and after traffic ends, using the provided OpenResty/Nginx version and environment details. Done means identifying a reproducible cause or documenting the missing evidence needed to isolate it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes, lua, nginx
- Domain
- api, backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100