== bytes per instance (= #bytes / #instances) from jcmd GC.class_histogram after loading 2,000,000 products class JDK 26 default JDK 27 default JDK 27 opt-out com.ankurm.memory.Product 40.0 32.0 40.0 java.util.HashMap$Node 32.0 24.0 32.0 java.lang.Long 24.0 16.0 24.0 java.lang.String 24.0 24.0 24.0 [B 32.7 32.6 32.7 == total bytes of those five classes jdk26-default 309088088 bytes (294.8 MB) jdk27-default 260853264 bytes (248.8 MB) jdk27-optout 309272896 bytes (294.9 MB)