Spring
June 6, 2020

M01 Q27 How many profiles can you have?

Spring Framework does not specify any explicit limit on the number of profiles. However, since some of the classes in Framework are using an array to iterate over profiles.

Example of this class can be found in the Spring. Its name ActiveProfilesUtils which used by the default implementation of ActiveProfilesResolver.

In Java, there is a limit on a number of elements in your array. And this limit is equal to the maximum value of Integer. , which is Integer.MAX_VALUE - 2,147,483,647 (2^31 − 1).