Original link: FastAPI in Production: From the Default Framework to the Edge of Performance and a Fair Comparison with Java / Agilista Desenvolvedor blog.
FastAPI (Python) vs Tomcat (Java).
FastAPI is indeed fast.
I suspect that Tomcat would do a lot better with more memory. JVM comes with some memory overhead and 1 GB is tight. I have not seen 1 GB in production for Java the last 20 years. For so little memory I would suggest Quarkus instead of Spring Boot.