java.util.AbstractMap.SimpleEntry对于64位JVM,空白实例应为24字节,对于32位JVM,空白实例应为12字节。这是我发现有用的@PeterLawrey的技术,基于MemoryUsageExamplesTest:
System.out.printf("The average memory used by simple entry is %.1f bytes%n", new SizeofUtil() { @Override protected int create() { Map.Entry<String, String> e = new AbstractMap.SimpleEntry<String, String>(null, null); return 1; }}.averageBytes());


