I use GAE(google app engine), make a very simple web application. in the method of processing request, i just create a big array of objects. After that, i delete all references to the array. After that, i call gc.collect.
But when i test (send request) for a long time, the memory usage of Dashboard continue increase.
I look like memory leak. But i think the code is ok.
below is a sample code.
from flask import Flask, request
import gc
app = Flask(__name__)
@app.route('/', methods=['POST'])
def hello():
gc.enable()
bigArr = []
for x in range(10000):
raw_data = request.get_data(cache=False)
bigArr.append(raw_data)
del raw_data
print('len(bigArr):' + str(len(bigArr)))
del bigArr
gc.collect()
return 'Hello World'
if __name__ == '__main__':
app.run(host='0.0.0.0', port=80, debug=True)
App engine config: runtime: python37 automatic_scaling: max_instances: 1