The native-image by default burns the set of classloaders: sun.misc.Launcher$ExtClassLoader, sun.misc.Launcher$AppClassLoader, ....
If ClassLoader.registerAsParallelCapable() is enabled, classloaders uses ClassLoader#parallelLockMap during parallel classes registration.
As a result, the ClassLoader#parallelLockMap contains several thousand of String->Object entries and all these entries from the map automatically burned into the image heap.
If Spring Boot classloaders (org.springframework.core.DecoratingClassLoader, org.springframework.context.support.ContextTypeMatchClassLoader,
org.springframework.core.OverridingClassLoader, ...) are initialized during the built time they perform ClassLoader.registerAsParallelCapable() calls and enables ClassLoader#parallelLockMap usage.
As a result, the image increases in a ~8-9Mb and also it can lead to an error during the image build (for example _"Static field or an object referenced from a static field changed during native image generation"_)
fixed with 9abecf764253a023c69882ca543848e3b4c9125e
Thanks @peter-hofer
Most helpful comment
fixed with 9abecf764253a023c69882ca543848e3b4c9125e
Thanks @peter-hofer