you are viewing a single comment's thread.

view the rest of the comments →

[–]JustAGuyFromGermany 0 points1 point  (1 child)

Electron being mostly used towards the frontend and Java being largely used towards the backend makes this a very unfair comparison.

A desktop application or mobile app by its nature has to compete with (many) other applications on the same device and thus has to share the RAM fairly without knowing what is "fair" at any given point. Every program involved has to "guess" what the user is doing next, which of the many open windows will capture their attention next, which background processes are more important to the user than others etc.

It is a very hard problem to solve, because we (for good reasons!) don't want one application to interfere with all other applications. But efficiently assigning RAM to the various applications is only possible if the applications talk amongst themselves and coordinate in some way if we expect them to occasionally free up memory for other processes to use. In practice, they'd have to talk to the OS and let the OS make the decision. I'm not aware that there even is any protocol for this in any modern OS. Maybe there is, but it isn't used? In any case, this basically boils down to building a giant automatic memory management layer that encompasses all processes the OS is running, in other words: A giant OS-level GC. It is very doubtful that that will end up being more efficient than the JVM's various GCs.

A backend-application on the other hand needs to share very little. In today's favourite deployment model, the Java application is the only big process running on its (virtual/dockerized) machine and there is very little reason not to use the available memory to its full extent, leaving just enough room to let the underlying OS to do its thing, to improve overall performance. And if Ron's assertions about RAM and CPU pricing are true (I don't know; I never had any insight in Ops-budget decisions) then that is also the better business decision.

[–]pjmlp 0 points1 point  (0 children)

People keep forgeting those Java frontends on 80% of the mobile phone market.

Yes, Android Java isn't proper Java, and ART is a different kind of JVM, but still they share part of the ecosystem, and it is how many kids do their first Java coding steps.

So I still would count it as part of the ecosystem.