Autoboxing can come at a substantial memory overhead. For example:
Map<Integer, Integer> square = new HashMap<Integer, Integer>();
for(int i = 256; i < 1024; i++) {
square.put(i, i * i); // Autoboxing of large integers
}
will typically consume substantial amount of memory (...