4 ms·
The author wonders why he does not see a memory footprint for the billions of objects, and conjectures they are stored in-line in the array. I suspect that it i
by superjan 2y ago
The author wonders why he does not see a memory footprint for the billions of objects, and conjectures they are stored in-line in the array. I suspect that it is actually achieved by the flyweight pattern, where copies of the same immutable (reference type) object are simply the same object.
- owl57 2y agoAll the numbers in that array are different.
- superjan 2y agoYou’re right. I’ll read more carefully next time.
- chipsrafferty 2y agoI'd be curious to know how they are stored, since the author either doesn't know either, or thought it wasn't important to tell us.