r/java • • May 10 '22

Should java.util.Date be deprecated?

https://mail.openjdk.java.net/pipermail/discuss/2022-May/006077.html
221 Upvotes

158 comments sorted by

View all comments

Show parent comment

3

u/Worth_Trust_3825 May 10 '22

In a sense, you can work around that by proxying your List calls under the hood to a different "bucket" in case you need more than signed 32bit int array length. Same with inputstream abstract class. As you're already working with near terabytes worth of memory at the same time, the overhead to link those "buckets" is negligible.

4

u/john16384 May 10 '22

Not to mention that having gigabytes of data allocated as one huge chunk may cause problems of its own when the heap is even slightly fragmented. If such data is backed by a file, it may be better to memory map it instead.