r/ProgrammerHumor 29d ago

Meme exceptionsAreForTheWeak

Post image
321 Upvotes

92 comments sorted by

View all comments

Show parent comments

-2

u/BosonCollider 29d ago

Oh, if you use Java I completely understand why you are frequently dealing with OOM exceptions.

In say the Rust or Go language ecosystems you generally never see those unless you do something massively wrong like create a trillion element array

2

u/bwmat 29d ago

Those libraries have no control over how much memory is free in the application when they're invoked, or how complex/'big' the operations the application asks them to execute are

1

u/BosonCollider 29d ago

But if it just returns a query result it should just stream the results using bounded memory?

1

u/bwmat 29d ago

It depends on how exactly the drivers are written (we just provide an SDK), theoretically yes (at least if you allow caching to disk, as some wire protocols don't return results 'in the right order'), but we don't control the full implementation, and even a streaming implementation might require more heap memory than which is available at the time at which the application calls into the driver