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.