# python app OoM-ing every week

**URL:** <https://community.fly.io/t/python-app-oom-ing-every-week/9800>\
**Category:** Questions / Help\
**Created:** [January 3, 2023, 5:45pm UTC](https://community.fly.io/t/python-app-oom-ing-every-week/9800 "2023-01-03T17:45:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raylu](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/raylu/32/6514_2.png) [@raylu](https://community.fly.io/u/raylu)\
**Post date:** [January 3, 2023, 5:45pm UTC](https://community.fly.io/t/python-app-oom-ing-every-week/9800/1 "2023-01-03T17:45:12Z")

</div>

I have a python webapp defined here: [mini\_healer\_tools/fly.toml at main · raylu/mini\_healer\_tools · GitHub](https://github.com/raylu/mini_healer_tools/blob/main/fly.toml)

it runs fairly well but every week, it runs out of memory and I get an email saying “[[Fly.io](http://Fly.io)] mini-healer-tools ran out of memory and crashed”

grafana shows a sawtooth pattern in the memory usage

 ![2023-01-03_09-42](https://global.discourse-cdn.com/fly1/original/3X/c/1/c1442a9fe08bd9b5f229b51122301fcb32b1aa3a.png)  
which strongly suggests a memory leak. however, having tried mprof, memory\_profiler, fil-profile, and memray, I can’t identify the cause of the leak. it’s also such a simple webapp that I would expect to be able to find it pretty quickly if there was one

my remaining ideas are that

1. something is causing the python GC to not run (perhaps it thinks it has more memory than it actually has to work with?)
2. the memory usage is caused by the [fly.io](http://fly.io) thing that serves static files

does anyone have any experience like this or any leads?
