2

I have a python application deployed in Google Cloud App Engine. When I deploy including google-genai in requirements.txt and doing "import google.genai as genai" in my code, the application restarts continuosly without answering requests properly. In Google Console I see messages like: "While handling this request, the process that handled this request was found to be using too much memory and was terminated. This is likely to cause a new process to be used for the next request to your application. If you see this message frequently, you may have a memory leak in your application or may be using an instance with insufficient memory. Consider setting a larger instance class in app.yaml.".

In Google Cloud Console Monitoring site, I see the application takes 300MB memory without genai library, it raises to 370MB when including genai and after that it reaches peaks of 1GB even if I do not do anything with the imported library. In case I don't import google genai, it stays stable in 300MB.

Anyone has had this problem and knows what can be happening?

I deployed several times with and without "import google.genai as genai" and the problem occurs only when that library is imported, even if I do not call any of its functions.

3
  • Please provide enough code so others can better understand or reproduce the problem. Commented Feb 5 at 16:09
  • can you share more details about the experiment / code details (without sharing any confidential/sensitive information)? I would love to try reproducing your scenarios Commented Feb 7 at 2:00
  • I'm seeing similar results. Just importing genai spikes memory requirement by 500+MB Commented Jun 12 at 12:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.