Hacker News new | ask | show | jobs
by jpgvm 1004 days ago
1. Yeah but serverless is completely unnecessary. JVM rewards you for long running processes. CRaC etc are there if you really care about that though.

2. If your Java code is using 5-10x more memory for the same task you are doing it wrong. Java objects do have higher overhead vs Go structs but not an order of magnitude. You could also be tuning the heap wrong, Java will use all the memory you give it and it won't be quick to give it back unless you tell it that it should.

1 comments

> serverless is completely unnecessary

I don't care for lambda either, but you can't just hand-wave away a huge portion of the current web. Devs use lambda, tens of thousands of them in fact. Java has an expensive startup and it affects them.

> you are doing it wrong

Perhaps, but I've seen it over-and-over again. Maybe you're extra talented, but regardless all us regular people seem to keep producing systems that are much more expensive to run with Java.

I didn't handwave it away. I alluded to there being existing solutions CRaC, AoT, GraalVM, etc. There are ways to entirely eliminate cold-start as a concern if it's important to you

My point was you don't ever -need- serverless. You might like it for whatever reason but it's completely unnecessary when long-lived processes can get the job done and have so many benefits. JIT of course but also connection pools, memory-local caches etc that all much much more important than "being on serverless" which is mostly a net-negative once you look at the picture more wholistically.

I also think it's wrong to go "hey I want to use serverless, what works well with serverless?" insted of going "what is the best tool to solve my problem? Ok now what is the best environment for that to run?".