I have come across a curious situation where students (I'm a teaching assistant in this context) have to implement their own version of a Singly Linked List (SLL) and compare it empirically with the Java standard library implementation of a Doubly Linked List.
And that's where it gets weird: I've seen multiple students note that the DLL profiles at roughly 0.5% extra space utilization compared to an SLL containing an equal number of elements of the same type. All the while basic analysis of the data structures tells me that a SLL has 2 references per node (1 to the next element, and 1 to the contained value) whereas a DLL has 3 (an additional one reference to the previous element). In other words, that is 50% more space usage per node (disregarding the size of the contained value).
The contained values are mostly Integer value objects so I don't think the size of the contained values matters too much here.
What causes this 2 orders of magnitude difference? I'm not entirely sure that "JVM/collections libraries optimization" can cover the whole difference; otherwise it'd have to be one hell of a JVM/java std lib optimization.