r/JavaProgramming • • 10h ago

Why does my Java application become slow after running for several hours?

6 Upvotes

I'm working on a Java application that performs database operations and handles multiple user requests.

Initially, everything works fine, but after running for a few hours, response times increase significantly.

There are no major errors in the logs.

For experienced Java developers, what would you investigate first?

Would you check memory usage, garbage collection, database connections, or thread management?


r/JavaProgramming • • 4h ago

Je veux faire du mappage sur des méthodes CRUD dans un DAO avec ReSTFul Web services sur un objet....

4 Upvotes

Salut, on a commencé les Web Services notamment JAX RS la semaine dernière et notre prof nous a demandé de mapper des méthodes CRUD créés dans DAO (architecture MVC) sur une classe nommée Produit. Les données se stockent pour le moment dans des listes. Maintenant je ne sais pas comment faire le mappage avec l'objet car il nous a dit de prendre en paramètre l'objet, pas les attributs quoi....sauf l'id au niveau de supprimer

Là je suis perdu, j'aimerais avoir de l'aide, des ressources et conseils... merci


r/JavaProgramming • • 5h ago

Top 5 Master.dev (Formerly Frontend Masters) Courses to Learn Java and Spring Boot in 2026

Thumbnail
medium.com
3 Upvotes

r/JavaProgramming • • 21m ago

I built a JUnit 5 add-on for testing Spring AI features: repeated runs, statistical baselines and record/replay in CI

1 Upvotes

Testing LLM features in Spring AI is awkward: the same prompt can pass one run and fail the next, so a plain assertion is either flaky or meaningless.

spring-ai-eval-baseline treats each LLM test as a small experiment:

- `@EvalTest(runs = 10)` runs the method N times and records the pass rate with a confidence interval

- The pass rate is compared with a baseline file; the test fails only on a statistically significant drop (Fisher's exact test), with optional latency and cost limits

- `RecordingChatModel` wraps any Spring AI `ChatModel`: record real answers once, then replay them in CI, offline and for free

- A Markdown report you can post as a pull request comment

Example:

```java

u/EvalTest(runs = 10)

void refundAnswerMentionsTheLimit() {

assertThat(bot.answer("Can I get a refund?")).contains("30 days");

}

```

I use it in one of my own projects: a regression test runs an LLM-based detector on a synthetic test set and fails CI if a prompt change makes detection worse.

Maven Central: `io.github.rrezartprebreza:eval-junit:0.1.0` (MIT, Java 21, Spring AI 1.0)

Repo: https://github.com/rrezartprebreza/spring-ai-eval-baseline

I'd like feedback on the API and the statistics. What would you need before using something like this at work?