I created the simplest Flask app I could imagine:
import flask
from flask import Flask
application = Flask(__name__)
@application.route('/')
def index():
return flask.jsonify(ok=True)
I deployed this app on 1/26 to Elastic Beanstalk. It has served 0 requests since deployment. Here is a graph of the memory usage, using Amazon's memory monitoring scripts:
You can see the little dip where (I assume) garbage collection happened on 1/29. But what on earth is allocating so much memory? If this is normal, how should I be monitoring memory so I can actually figure out if my (real) application has a memory leak? Is this Flask's fault, Python's fault, AWS's fault, ...something else?
Edited to add: I switched over to using mod_wsgi this aftenoon, but it didn't seem to have any effect. Updated graph (the dips are deploying new versions, it took a few tries to get the config right):
Output of free -m
:
total used free shared buffers cached
Mem: 532 501 31 0 81 37
-/+ buffers/cache: 381 150
Swap: 0 0 0
Is that memory actually being used or is it cached? SSH into your beanstalk instance and use the free
command to determine this. This article has a good breakdown of how to determine whether your RAM is actually used or cached and what it means.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With