Remix.run Logo
Java is memory efficient [audio](inside.java)
19 points by he0001 4 days ago | 15 comments
indolering 2 days ago | parent | next [-]

For a definition of "efficient" that isn't shared by anyone else. This isn't a new rationale either, but a well known trade-off involved with JIT compilation and garbage collection. It's the reason Chrome "hogs" memory and Firefox is perceived as slow: they make different resource usage tradeoffs.

It will be interesting to see if the current memory crunch will impact this calculus going forward.

himata4113 2 days ago | parent [-]

Firefox uses more memory than chrome in all my tests when I was using it for VNC (x11).

TexanFeller 2 days ago | parent [-]

FF seems to use less RAM than Chrome for my 100+ open tabs these days. It’s just as fast for 99% of sites and surprisingly even compatibility is often better. Half the time when my wife encounters a broken webapp in Chrome it works fine when I have her try in FF.

himata4113 2 days ago | parent [-]

that seems kind of irrelevant since that's just based on how aggressive backgrounding is no?

sakesun 2 days ago | parent | prev | next [-]

Java was designed to make manual memory management a non-concern. Yet, ironically, it's the runtime that require more explicit memory tuning than any others.

gf000 a day ago | parent | next [-]

It absolutely doesn't need any memory tuning whatsoever. People just read 2 decades old blog posts and apply whatever random flag they see.

For 90% of workflows you don't add any command line arguments, for the remaining 10% you may specify a heap size. That's all.

eerikkivistik a day ago | parent [-]

Perhaps you work on simple CRUD applications? In my experience the 90/10 are reversed.

gf000 a day ago | parent [-]

What do you need it for? Which version of the JVM?

moring a day ago | parent | prev [-]

This does not match my experience. The amount of manual tuning needed for memory management in C/C++ (which Java was designed to improve upon) was orders of magnitude greater than with Java just to get it correct, let alone efficient in terms of memory usage and performance.

yomismoaqui 2 days ago | parent | prev | next [-]

- War is peace

- Ignorance is strength

- Java is memory efficient

nitwit005 2 days ago | parent | prev | next [-]

I agree with all the general principles, but the details of Java do matter here. There is a reason they're working hard on Project Valhalla: https://openjdk.org/projects/valhalla/

njitbew 2 days ago | parent | prev | next [-]

> But what's the point in leaving available memory on the table if using it makes your program run faster? Efficient use of that resource wouldn't be to leave it untapped but to use it to speed up the program.

What’s the point of having a host with available memory? In today’s clouds, couldn’t you just downsize the host, and save on cost?

pestatije 4 days ago | parent | prev | next [-]

so its not memory efficient then...and nowadays the bottleneck is in memory access not cpu cycles, so the claim more memory use speeds up compute is very doubtful

gf000 2 days ago | parent [-]

It doesn't use more memory (at least not due to GC itself), it wastes some memory that it won't touch again unless absolutely necessary.

maxlin a day ago | parent | prev [-]

Drift cars make efficient use of the whole width of the road, too.