Search code examples
google-cloud-platformmemory-leaksgoogle-cloud-functionsprofiler

How to memory profile GCP Cloud functions?


I have a Node.js code which runs GCP cloud function. Functions runs fine with 1-2 instances, but when its instance level is higher, there is some kinda memory leak & memory graph on GCP CF shows 99 percentile, How can I do a effective memory profiling?

My R&D lead me to Stackdriver Profiler, but it says CF is not supported yet here.


Solution

  • There is currently no specific tool GCP offers to test Cloud Functions for a memory leak. As John mentioned, an option would be to test the code you're using in your function locally.

    You might find this article about memory leaks in Node.js useful as a reference.