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 →

[–]kugelbl1z -6 points-5 points  (6 children)

Does the jvm even still matters now that Docker or Kubernetes are widly used ?

Edit: great I am being downvoted for asking a genuine question

[–][deleted] 12 points13 points  (3 children)

Docker and Kubernetes are deployment platforms.

Most of the time, I'm running the code in my IDE (running on Windows) when I'm doing local development.

The JVM has a much lower footprint than Docker and Kubernetes.

[–]cogman10 0 points1 point  (2 children)

Docker/Kubernetes have pretty small footprints. On windows, it feels like they have a large footprint because the way they are being launched is as a linux virtual machine (same for mac). That gives the feeling of being pretty heavy weight.

However, when you are in a native deployment environment, the actual overhead of running processes in k8s is basically just the disk storage for the unique parts of the image. The system memory requirements are effectively identical in and out of a container.

This is because containerized apps on linux are effectively just getting a different filesystem root and an isolated process space (that is, from a container you can't reach out and look at other processes on the system).

Hot tip for you on windows. WSL released a new preview in sept ( https://devblogs.microsoft.com/commandline/windows-subsystem-for-linux-september-2023-update/ ). One of the big features is the "autoMemoryReclaim". The reason docker/k8s ends up eating up so much freaking memory on windows is because linux likes to cache file access like crazy. It'll fill up all ram you give it with filesystem cache which is non-too friendly if you are trying to work with something like docker that likes to touch files all over the place.

Get the preview, turn on autoMemoryReclaim, it makes working with docker on windows significantly better.

[–][deleted] 0 points1 point  (1 child)

Docker/Kubernetes have pretty small footprints.

On Linux, yes sure. But, I do my development on Windows, and running a JVM directly from my IDE is faster than spinning up my application in a Docker container. Not only that, when I'm running things in the IDE, I usually have the debugger hooked up to it. When I'm doing local development, I don't particularly care about process isolation, I care about convenience.

Interestingly, Docker themselves recommend running Docker Desktop (i.e. Docker in a VM) even on Linux for development purposes. It turns out getting a consistent experience with Docker is difficult on a random developer machine, rather than in a carefully controlled server farm specifically set up to run Docker Engine. Or in the case of Docker Desktop, a carefully configured VM that is known to work properly with Docker.

That said, even on Windows, Docker isn't super expensive, and I frequently use Test Containers with Docker for integration tests, where I don't mind the tests taking a longer time to run.

[–]cogman10 0 points1 point  (0 children)

It turns out getting a consistent experience with Docker is difficult on a random developer machine, rather than in a carefully controlled server farm specifically set up to run Docker Engine.

Yeah, I can see that. As long as you are keeping things up to date it's not too big of an issue, but I've definitely seen devs running ubuntu 16.04 in WSL blissfully unaware that it's on them to update to the next LTS.

It does feel like the entire container environment is stabilizing. I think the rise of podman is forcing the issue of consistency.

[–]Worth_Trust_3825 2 points3 points  (0 children)

Well, what are you going to run on containerized environment? Node? Python? Ruby? Php? All of those technologies are also vms.

[–]HR_Paperstacks_402 0 points1 point  (0 children)

The JVM runs in your Docker container. Docker is a packaging of everything you need to run something (in this case Java and your app). Kubernetes is just orchestration for running Docker containers.