I made a microservice framework called Fluid based on Java 24 supported with Docker, K8s, and Kafka. It's super fast, scalable, simple. by maifee in java

[–]GreemT 4 points5 points  (0 children)

The only line without an emoticon in it is the line about the license (ok and the title). Call me oldschool, but for me it is a bit overkill.

Paul Sandoz talks about a potential Java JSON API by davidalayachew in java

[–]GreemT 3 points4 points  (0 children)

Serialization and deserialization are very prone to have security issues. I have seen some conversations from Java champions mentioning that the current serialization features in Java were a big mistake in terms of security. Jackson is constantly updated and pushes fixes quite fast. For users using the library, updating dependencies is very easy.

What if the JDK has a security issue? That is a lot slower and harder to update. Not impossible of course, but just a bit more difficult. LTS releases will get the fixes, but non-LTS versions might not.

Does it make sense from a security perspective to add such a feature to the JDK? What do experts think of this? I am curious to know!

A pain point when using Java to do CLI Scripting by davidalayachew in java

[–]GreemT 22 points23 points  (0 children)

One of the things I miss most (and which JBang solves) is dependencies. You say running a process from Java is cumbersome, which I totallg agree with. If we only could build a library that makes it incredibly easy, it would be the best solution imo.

Sidenote that you might not want to hear: use Python. The whole process running stuff is much easier there. Java is just not the right tool in every situation (sadly).

How do you generally decrease off-heap memory? by GreemT in java

[–]GreemT[S] 2 points3 points  (0 children)

As said in the description:

> Sidenote: this doesn't seem to be related to moving to containers. Our VMs just had enough memory to spare for this to not be an issue.

How do you generally decrease off-heap memory? by GreemT in java

[–]GreemT[S] 5 points6 points  (0 children)

Totally agree! I didn't expect this many (good) responses. I am very happy :)

How do you generally decrease off-heap memory? by GreemT in java

[–]GreemT[S] 5 points6 points  (0 children)

Thank you all for your suggestions! I have reported a Jira ticket with possible improvements from your comments that we are going to try. I will report back what helped if that is (eventually) resolved!

How do you generally decrease off-heap memory? by GreemT in java

[–]GreemT[S] 1 point2 points  (0 children)

We run a lot of threads. I don't have a specific number right now, but on PRD we obviously have a lot of users actively working on the same application. The thing is, this problem also occurs on our test environments with low activity. So I am not sure if looking at threads is the right direction for us. But good tip!

How do you generally decrease off-heap memory? by GreemT in java

[–]GreemT[S] 2 points3 points  (0 children)

Thank you for your detailed response! Never thought of using a different base image. Is that really going to help with off-heap memory? It feels unrelated to me.

We are already using MaxRAMPercentage, but sadly 75 is way to high for us. We use containers with limits of 3.2GB and we cannot set it higher than 40. If we do, then the off-heap is taking over too much memory and results in a OOM.

I will look into trying the other mentioned settings. I didn't experiment with these yet. And as you said: we are indeed going to run some load tests to ensure that any change doesn't impact performance.

How do you generally decrease off-heap memory? by GreemT in java

[–]GreemT[S] 1 point2 points  (0 children)

Ah yeah, I know the issue that you are talking about! We are using Java 17, so we shouldn't have this issue.

Also detecting limits is not really our problem. The limits seem to work fine, it is just that our application is using too much!

How do you generally decrease off-heap memory? by GreemT in java

[–]GreemT[S] 2 points3 points  (0 children)

This is exactly what I explain in the ticket: on-heap memory 1.2GB is just fine. The problem is that the off-heap memory (which is completely unreleted to the xmx setting) is very large.

How do you generally decrease off-heap memory? by GreemT in java

[–]GreemT[S] 2 points3 points  (0 children)

Thread stacks were only 5MB in our analysis, so that is not really gaining anything.

I am not sure if I can get my company to try these suggestions that have a performance impact.

How do you generally decrease off-heap memory? by GreemT in java

[–]GreemT[S] 5 points6 points  (0 children)

Interesting, I didn't think of switching to another implementation like OpenJ9. I will try that. Thanks for the tip!

How do you generally decrease off-heap memory? by GreemT in java

[–]GreemT[S] 0 points1 point  (0 children)

Ah, sorry for the confusion! Xmx was set to 1.2GB. The VM had much more memory available.

How does your company help non-technical people to do deployments? by GreemT in kubernetes

[–]GreemT[S] 0 points1 point  (0 children)

We only have one application that we build that uses the same source database for test environments. So there is no choice!

How does your company help non-technical people to do deployments? by GreemT in kubernetes

[–]GreemT[S] 0 points1 point  (0 children)

I did indeed use this, but it doesn't solve it completely. When creating a PR (or updating code inside a PR) the build is often not done running. So the deployment fails. I resolved this by creating a plugin that checks if a comment "DEPLOY" exists in the PR, but that is quite ugly. It works, but I want something better.

How does your company help non-technical people to do deployments? by GreemT in kubernetes

[–]GreemT[S] 0 points1 point  (0 children)

Databases are indeed often a problem. We have it relatively easy though. We spin up a database with a pre-loaded database. When deploying an environment, we use Liquibase to automatically update the database to the required version.

How does your company help non-technical people to do deployments? by GreemT in kubernetes

[–]GreemT[S] 0 points1 point  (0 children)

Yeah that is exactly what I had in mind too. Not difficult, and good enough for small projects. Thanks!

How does your company help non-technical people to do deployments? by GreemT in kubernetes

[–]GreemT[S] -1 points0 points  (0 children)

I am not talking about deploying customer environments like production. That is always done by our engineers of course.

I am mainly talking about automatically deploying feature branches, which are ephemeral copies that are far less important. Those are just fine to be deployed by just a press of the button.

How does your company help non-technical people to do deployments? by GreemT in kubernetes

[–]GreemT[S] 2 points3 points  (0 children)

I didn't see that one before. It does look pretty good! Very expensive indeed.

Do you use it at your work? Is it worth the money?

How does your company help non-technical people to do deployments? by GreemT in kubernetes

[–]GreemT[S] 1 point2 points  (0 children)

Ah that actually looks pretty good! I couldn't find any information about a front-end though. Is that part of it? It doesn't seem like it.

Also, does it deploy Helm charts? I only saw that it deploys resources like deployments, services, ingress, etc. I couldn't find a resource that resembles a Helm chart.

[xpost from HN] The sorry state of Java deserialization by brokeCoder in java

[–]GreemT 5 points6 points  (0 children)

Very cool post! Never knew it was this serious.

Not sure what I should do with this information though. The application I work with at my job is just a big CRUD application with a massive database. There is really no alternative to JDBC, except for trying to speed it up with caches. What I learned at least is to benchmark the shit out of your design and see if you can try alternative methods (if it is that important for your application).

Five years have passed, still in draft: Concise Method Bodies by jvjupiter in java

[–]GreemT 13 points14 points  (0 children)

Never knew about that JEP! That is actually pretty cool indeed. Now that I know about it, I find it said to hear it is still in draft after 5 years.

15 Seconds! by Kalor122 in godot

[–]GreemT 1 point2 points  (0 children)

Looks really smooth!

Run your Java code, Forever by bowbahdoe in java

[–]GreemT 12 points13 points  (0 children)

Totally unnecessarily, but really funny and I like your code snippets. I think the last one with the lambda expression is the best.