The memory leak became visible with the help of the stackdriver profiler. https://cloud.google.com/profiler/