flask-memory-leak Exploring memory leak in flask app After serving a request route function do not keep state. If we need to keep state, variable has to be declaired outside the routes.