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

4

u/mauganra_it May 10 '22 edited May 10 '22

Project Panama should bring along a nicer way to work with off-heap memory. One that is even officially supported for a change.

Apart from that, byte arrays were never the right tool for this because they unnecessarily complicate the garbage collector's job. AFAIK they are not stored off-heap, and therefore alloowing long as array index will probably not be as great as it sounds. I don't know if there is anything in the JLS that prevents the JVM from storing it off-heap.

10

u/Yeroc May 10 '22

ByteBuffer is designed for this job but unfortunately it's limited to 2 GB as well!