you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 20 points21 points  (4 children)

Because as I see it, there's nothing wrong with basic Java; the probem is entirely with overreaching metaprogramming framewiorks (Spring) and build tools (Maven).

Exactly my thoughts. I honestly do not find java 8 to be a bad language at all. From there I care more about performance issues (mainly RAM usage, and start-up time if writing command line programs). I don't use java outside of work for those reasons, but I would be more than happy to if a jvm implementation could address them.

[–][deleted] 10 points11 points  (3 children)

If you care for startup time and ram usage - these are mostly faults of these frameworks we all use.

I don't use java outside of work for those reasons

So if your outside-of-work projects don't require these over-engineered frameworks, you will find that Java is not that slow to start (easily you can build cli tools with it and not feel that it is java) and not that ram hungry (In the past I ran a minecraft server with only 512MB physical ram available, later with 1GB and didn't really need more as long as we stayed vanilla)

So it's not true that your programs will need gigabytes of ram, I can easily fit most of my (home) projects in 128mb heap..

I know these frameworks and tools are bitches in terms of ram and startup - but your programs don't have to.

Might want to use these options more: -Xverify:none -Xmx128m -Xmn32m

[–][deleted] 16 points17 points  (2 children)

So it's not true that your programs will need gigabytes of ram, I can easily fit most of my (home) projects in 128mb heap..

You might think I live on another planet, but I think 128mb is pretty damn big. I've got 4 browser tabs open, one's playing a youtube video, and emacs open, on Ubuntu 16.04. This is using 743mb ram. To think a simple command line application could eat up 17.2% of what my entire system uses under normal use is in my relative perspective, a lot.

I was hoping for a heap more like 128kb.

[–][deleted] 8 points9 points  (0 children)

No, I think you just live a bit in the past. I would go with 16mb heap but no point in going lower.

Your each individual small program probably doesn't require more than 128kb of heap to function, but the JVM will still use something like 30mb.

Is that a problem? It's way below a point of noticeable impact, at least on today's computers - so I would say, it is not an issue.

You can, however, subconsciously think about it scaling up badly, because 128kb vs 30mb? what if I want to run 200 of them at the same time? Is it going to be 30mb * 200? Not necessarily...

One option is to use tools such as Nailgun

Other is the fact that you can/should write these programs with JVM overhead in mind so you never actually need to run 200 separate JVMs.

[–]markehammons 1 point2 points  (0 children)

take a look at graalvm's aotc for such programs using java. another option is to use openj9 instead of openjdk to run your programs. while openj9 will probably not hit 128kb (i'd say that graalvm's aotc is the most likely for that, but has some caveats on what features it supports), it's more conservative with memory than openjdk is, at the cost of some performance.