Can Java Compact Profiles reduce memory?

My understanding of loading a Java class is that its lazy loaded. Thus, if you have a bunch of unused jars that come with a Java application, they will only waste disk space and actually not consume memory. However, apparently, this is implied in various Oracle blogs and documentation that compact profiles actually reduce memory footprint ( here and here ).

To make it easy to answer yes or no, this is not subjective:

If I do "hello world!" Java application (i.e. only using System.out) will it have a smaller memory size while working with profile compact1, and not with full SE? (I would have experienced it myself, but I had problems compiling compact profiles).

+4
source share
2 answers

There are three compact profiles according to the documentation :

The compact1 profile loads Core (java.lang. *), Security, Serialization, Networking, Ref Objects, Regular Expressions, Date and Time, Input / Output, Collections, Logging, Concurrency, Reflection, JAR, ZIP, Versions, Internationalization, JNI, Overlay Engine, Extension Engine, Scripting

compact 2 JDBC, RMI, XML, JAXP

compact 3 (kerberos, acl sasl), JMX, JNDI, XML JAXP2, Management, Instrumentation

-profile javac.

, System.out :

Bootstrap - , Java 2. Bootstrap rt.jar jar jre/lib.

.

, . -Xbootclasspath cicrcumstances, .

, , , compact1, "Hello world", System.out , -Xbootclasspath , , .

0

, .

JVM :

  • ,
  • rt.jar
  • , , ,

. , . , , :

pmap <jvm pid>

pi compact1 12 .

0

All Articles