Skip to content

Impossible to run Spring Boot applications with default configuration and <512M #663

@sdeleuze

Description

@sdeleuze

The fact that it is not possible to run a Spring Boot hello world (MVC or WebFlux) with less than 512M and that most non-trivial applications requires at least 1G on Cloud Foundry is pretty frustrating for users, and give the false impression that Spring Boot can't run with less than 1G of memory.

We are doing some work with @dsyer, Boot team and others to optimize Spring Framework and Spring Boot to generate less GC pressure and have lower memory consumption, but I tend to think we could also improve Cloud Foundry to handle that in a better way.

I have raised cloudfoundry/java-buildpack-memory-calculator#24 about the memory calculation rule.

Another point: if the number of class is computed by counting all the .class files in the application including its dependencies, it is not a reliable source of information for Spring applications that has not a very fine grained JAR granularity and will load effectively just a small ratio of the classes available on Spring JARs.

The problem is even more visible with the optimizations we have shipped in Spring Boot 2.1, and the optimization we are currently working on for Spring Boot 2.2.

My gut feeling is that typical users knows how much Xmx memory is required locally by their application, and we should maybe use that information by default.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions