top | item 14711970

(no title)

tieTYT | 8 years ago

> Why does this matter? It matters for the exact same reason why memory leaks are bad in general: They consume more memory than necessary.

Thing is, this doesn't usually matter. I have never gotten an out of memory error from a leak in Java. Now compare that to all the development time I've saved by not having to deal with pointer arithmetic. I consider it a huge win. It's all about the type of apps you're making.

discuss

order

majewsky|8 years ago

When I play Minecraft on my notebook, I first shut down all nonessential system services (I have a handy line in the shell history for that). This allows me to get around 45 minutes out of Minecraft (instead of 30 minutes) before it gets struck by the OOM killer.

khedoros1|8 years ago

Hmm, weird. I've never had Minecraft killed for OOM, since starting to play in the alpha days. In fact, I can watch the memory pool slowly grow, then a drop in framerate and increase in free memory when the GC is triggered every 30 seconds or so.

I don't do anything special to play; my sessions used to run into multiple hours, during my peak years of play.

I suspect that it's not fair to blame Java for whatever problem you were having, though.

tieTYT|8 years ago

I've used tons of programs that have problems and crash for various reasons. Is this an argument against the language? I don't think there'd be any left to use with this line of thinking.

Besides, there's too many variables in your anecdote. Is it a laptop from 1995? Is the OOM from a bug that could/should be fixed?

detaro|8 years ago

Have you tried limiting the heap size with -Xmx <size>? If it has a bad (too large for your system) default it might grow to much before running GC.

AstralStorm|8 years ago

You haven't used anything nontrivial then. Say, IntelliJ eating 2 GB of RAM, quite a lot for a glorified editor...

seanmcdirmid|8 years ago

Just because IntelliJ is using 2GB of RAM doesn't mean they have a memory leak. As long as that 2GB profile is stable, it isn't going to bring down the system.

tieTYT|8 years ago

I didn't build that. How are you so sure it would have less leaks if it were written in a language like C++? I'd bet it would be worse.