r/programming • u/Happycodeine • Jan 04 '19
Using Java to Read Really, Really Large Files
https://medium.com/@paigen11/a6f8a3f44649
7
Upvotes
r/programming • u/Happycodeine • Jan 04 '19
View all comments
Show parent comment
1
u/[deleted] Jan 07 '19 edited Jan 07 '19
It's not confusing. It's just marketing fluff: it doesn't give any real information, but is written to make you feel better about using it.
Reminds me of this Soviet era joke:
Java really has nowhere near the required machinery for doing direct I/O, as a system programmer would have imagined it. The fact that you can allocate something outside JVM's GC'ed heap is only one of the many prerequisites for doing that. But Java has no hopes of meeting those demands because it doesn't have the necessary tools in the language. Even if you try emulating pointers through passing integers and an opaque reference to the allocated memory, you cannot really feed your results into any built-in or third-party functions, which expect Java objects (like integers, strings, byte arrays etc.) and if you try to build your own replacement for those kinds made of opaque references and integers for pointers, you end up dealing with problems of garbage collection, thread safety etc. all on your own.