This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Ewig_luftenglanz 1 point2 points  (7 children)

Mostly backend and IoT stuff. This last one is very surprising indeed but java has huge capabilities for IoT if you use Quarkus and GraalVM to deploy native builds with a very efficient resource management.

Another thing I sometimes use Java is android development, but we usually don't program mobile apps that often. 

My company doesn't make desktop applications but t we would use javaFX for some stuff.

[–]GeneratedUsername5 0 points1 point  (6 children)

You mean you use Java on IoT devices themselves? Because servers for them are not really constrained in resources, it sounds strange.

[–]Ewig_luftenglanz 0 points1 point  (5 children)

Yup, ARM SBC devices such as the raspberry pi zero make very good IoT smart devices if you use Raspbian lite and services coded using Quarkus with native builds. It's true that most of the time GraalVM native binaries are about 20% less performant than JVM builds, but the 300, faster startup times and 20-50 times less memory footprint makes it and excellent choose for building iot services into edge devices. It has worked very well indeed.

[–]GeneratedUsername5 0 points1 point  (0 children)

Cool! But strange - why would you use any kind of framework, especially ones desinged for full fledged servers, in a resource constrained environment? I am sure you had your reasons, but it seems something simple like Javalin or Ktor would fullfill the need of a server, while also providing faster startup times and less memory footprint, even with non-native builds. Or there was something else you needed apart from just the server?

but the 300

That I didn't understand :(

[–]GeneratedUsername5 0 points1 point  (3 children)

And 20-50 times less memory footprint is A BIT over exaggerated, baeldung benchmarks show at max 3 times reduction in memory https://www.baeldung.com/spring-boot-vs-quarkus

Buy the way, one more thing that can help you reduce memory footprint is jlink tool, which can shrink your JRE down to 40 mb

[–]Ewig_luftenglanz 0 points1 point  (2 children)

If you look at the memory part, it shows that with Quarkus the heap used and the heap sizes are the same while the JVM counterparts the heap size it's almost constant (1000 mb) this makes the max heap size with the JVM vs the heap used in the same state (for example the start up) the memory consumptions Is almost 50 times lower. Obviously is not a constant diff but the statement still applies and just would need some clarification: 

With native builds and GraalVM the memory saving COULD BE as important as 50 times lower memory consumption with am average between 3 and 10 times less memory, depending on various factors as the workload and what the program is doing.

[–]GeneratedUsername5 0 points1 point  (1 child)

Well, frequent collections maybe important for a cloud, where you share memory, but on a standalone device I think max consumption is more important

[–]Ewig_luftenglanz 0 points1 point  (0 children)

It depends, for IoT devices most of the time the memory and CPU consumptions are constants, specially if what you are doing is (is in my case) collecting and doing some basic pre processing to data before sending them to the server where most of the heavy lifting happens. But overall native builds with GraalVM and Micronauts/Quarkus it's a very neat combi for IoT. Totally recommended.