My understanding of Java Class loading is that its lazy loaded. Thus if you have a bunch of unused jars shipped with a Java application they will only waste disk space and not actually consume memory. However it seems to be implied on various Oracle blogs/documentation that compact profiles will actually reduce memory footprint (here and here).
To make it an easy yes or no question that is not subjective:
If I make a "hello world!" Java application (ie only using System.out) will it actually have a smaller runtime memory footprint when run by a compact1 profile instead of the full SE? (I would test this myself but having trouble compiling the compact profiles).
Yes, compact profiles will reduce memory footprint.
During the JVM startup several things happen:
Different compact profiles include different set of technologies. Thus reducing number of loaded objects into memory. You could check what exactly loaded into memory using the command:
pmap <jvm pid>
On my raspberry pi with profile compact1 and default heap size I've got 12Mb.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With