# Forcing Processes to recycle to avoid memory leaks

**URL:** <https://discourse.haproxy.org/t/forcing-processes-to-recycle-to-avoid-memory-leaks/7408>\
**Category:** Help!\
**Created:** [February 16, 2022, 7:16pm UTC](https://discourse.haproxy.org/t/forcing-processes-to-recycle-to-avoid-memory-leaks/7408 "2022-02-16T19:16:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lserranov](https://avatars.discourse-cdn.com/v4/letter/l/3bc359/32.png) [@lserranov](https://discourse.haproxy.org/u/lserranov)\
**Post date:** [February 16, 2022, 7:16pm UTC](https://discourse.haproxy.org/t/forcing-processes-to-recycle-to-avoid-memory-leaks/7408/1 "2022-02-16T19:16:35Z")

</div>

is there a param that after certain number of requests or hours of operation, the processes get recycled to get rid of any memory growth or memory leak?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [February 16, 2022, 8:22pm UTC](https://discourse.haproxy.org/t/forcing-processes-to-recycle-to-avoid-memory-leaks/7408/2 "2022-02-16T20:22:12Z")

</div>

No, there is not. Problems will be fixed, not swept under the rug.

---

<div class="post-metadata">

**Author:** ![lserranov](https://avatars.discourse-cdn.com/v4/letter/l/3bc359/32.png) [@lserranov](https://discourse.haproxy.org/u/lserranov)\
**Post date:** [February 16, 2022, 9:17pm UTC](https://discourse.haproxy.org/t/forcing-processes-to-recycle-to-avoid-memory-leaks/7408/3 "2022-02-16T21:17:08Z")

</div>

Hi @lukastribus , understood, thanks for sharing. Maybe one final question:

Say that I see memory growth and I want to recycle haproxy daily until the issue gets addressed. In such case what is the best way to recycle the process so that users do not get affected?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [February 16, 2022, 9:20pm UTC](https://discourse.haproxy.org/t/forcing-processes-to-recycle-to-avoid-memory-leaks/7408/4 "2022-02-16T21:20:15Z")

</div>

Same as with configuration or code upgrades: reload haproxy, so that existing users are not disconnected. If the old process keeps running too long due to old connections keeping it alive, restrict it with [hard-stop-after](https://cbonte.github.io/haproxy-dconv/2.4/configuration.html#3.1-hard-stop-after).
