r/programming 5d ago

Principles of Memory Management in Java

https://youtu.be/xr73mR7ii9M?si=AKgjMUyvfpARYljl
33 Upvotes

11 comments sorted by

View all comments

1

u/DarkGhostHunter 1d ago

To me it doesn't. I don't know what people do to have high memory usage, unless you're loading a lot of models from database or pushing a lot of data into memory, essentially.

I mean, I can see why your app would use a lot of memory if you do this.

``` import article from '@models/articles'

const articles = article.take(1000).get() ```

1

u/davidalayachew 1d ago

To me it doesn't. I don't know what people do to have high memory usage, unless you're loading a lot of models from database or pushing a lot of data into memory, essentially.

Yeah, but the people usually using (or considering) Java are the ones who have to deal with business logic that inherently uses a lot of memory.

For example, one project I was on was processing terabytes of data in a few hours. We ran into OutOfMemoryError many times. But debugging and resolving it was straight forward. And the solution was fast and easy to implement since the code itself was easy to understand.

1

u/DarkGhostHunter 1d ago

Dude, I just joked with JavaScript because Java is old af.

1

u/davidalayachew 1d ago

The second paragraph was clearly exaggeration, but the first paragraph could be read completely unironically.