Java, Kotlin and the JVM
25 subscribers
20 photos
2 videos
117 links
Java, Kotlin, Gradle, Maven, JDKs, Spring and the whole JVM ecosystem tips & tricks. 🇪🇸 & 🇬🇧
Download Telegram
I will publish more detailed posts about most relevant features for me 🤞🤝
https://blogs.oracle.com/java/post/the-arrival-of-java-25
🚀 Java 25 introduces Compact Object Headers, a feature designed to shrink object sizes!

📦📏 This feature reduces the size of object headers from 96-128 bits down to just 64 bits on 64-bit systems.

🤔 What does this mean for your apps?
Smaller heap sizes 💾
Improved deployment density
Increased data locality

This feature was included a experimental in Java 24 (JEP 450 - https://openjdk.org/jeps/450) 🧪 and is now a stable feature in Java 25 (JEP 519 - https://openjdk.org/jeps/519)! 🎉

⚠️ Important: It's not enabled by default. You need to activate it with a JVM flag.

💻 To enable it, simply use this command:
java -XX:+UseCompactObjectHeaders MyApp


📚 Want to learn more? Check out the detailed article from InfoQ for performance benchmarks:
https://www.infoq.com/news/2025/06/java-25-compact-object-headers/
Ever call Java 21 an "LTS release"?

OpenJDK's own site already says it's "superseded." 💀
👉 https://jdk.java.net/21/

Friendly reminder:
LTS comes from vendors (Oracle, Azul, etc.), not OpenJDK.

OpenJDK just builds the JDK for ~6 months and dips. 😂

It's not an "LTS version," it's a version that gets LTS. Pass it on!

P.S. Yeah, this is a semantic debate, but it's relevant for understanding the difference between OpenJDK (the project), Java (the language), and the vendor distributions we all use. 👍
I have compiled a list of what I think are the most interesting and useful security enhancements in this release. I have also grouped them into appropriate categories (crypto, TLS, etc) which should make it easier to find out what has changed in each specific area

Summary

🔑 PEM Encodings: New API to easily handle keys/certs in PEM format.
⚙️ KDF API: Final version of API for deriving keys.
🛡️ SHA-1 Disabled: SHA-1 is now off by default for TLS handshakes.
TLS/CNSA 1.0 Requirements: Adds modern algorithm requirements.
🚀 Performance: Faster crypto algorithms (ML-KEM, ML-DSA, ChaCha20).

https://seanjmullan.org/blog/2025/09/23/jdk25
Estaba viendo un video de la serie #RoadTo25 y encontré unas notas interesantes (https://cr.openjdk.org/~skuksenko/jep519/performance.txt) sobre las posibles regresiones de rendimiento al habilitar Compact Object Headers (COH).

El presentador habla de ello a partir del minuto 6:27 del video.

Obviamente, el resumen esta claro COH es un trade-off. En teoría, un menor consumo de memoria debería mejorar el rendimiento al reducir el use del recolector de basura (GC) y aprovechar mejor la caché de la CPU. Pero, como todo trade-off, tiene un coste, como tiempos de inicio más lentos o un impacto negativo en ciertos benchmarks.

Al parecer, construir un archivo de Class Data Sharing (CDS) puede ayudar a mitigar esos problemas de rendimiento en el arranque, no es una feature que yo haya usado y tengo la impresión que no es muy usada en general.

De todos modos, me encanta indagar en estas pequeñas peculiaridades porque me ayuda a entender mejor el potencial de la JVM como plataforma a gran escala.

📹 https://www.youtube.com/watch?v=renTMvh51iM&t=383s
Ni me acordaba de los Applet ya 🤣

👋👋👋👋👋👋👋👋👋
Remove the Applet API, which was deprecated for removal in JDK 17 (2021). It is obsolete because neither recent JDK releases nor current web browsers support applets.


Hasta Java 26 llegaron (https://openjdk.org/jeps/504), al parecer Firefox quitó soporte de applets en 2017

Si no sabes que era un applet 👉 https://www.vice.com/en/article/a-brief-history-of-the-java-applet/
Opentelemetry declarative configuration (aka yaml) disponible para el Java Agente de la versión 2.20 (principios de septiembre)

-----

Declarative configuration uses a YAML file instead of environment variables or system properties.

💡This approach is useful when:
👉 You have many configuration options to set
👉 You want to use configuration options that are not available as environment variables or system properties

🔗 https://opentelemetry.io/docs/zero-code/java/agent/declarative-configuration/
Las conexiones cliente-servidor siempre van a fallar, y la forma en que gestionamos esos errores es clave. El retry es una estrategia fundamental, pero hay diferentes niveles de complejidad.

A mi me gusta ver la evolución del concepto a través de dos librerías de referencia en el ecosistema Java:

Resilience4j (https://github.com/resilience4j/resilience4j): Ideal para empezar. Ofrece patrones de resiliencia como Circuit Breaker y Rate Limiter, y es perfecta para implementar estrategias de reintento más clásicas como el backoff exponencial o con jitter. Es la base para construir sistemas robustos.

Netflix Concurrency-Limits (https://github.com/Netflix/concurrency-limits): Esta es la siguiente evolución. En lugar de reintentos basados en tiempo, se enfoca en limitar la concurrencia. Utiliza algoritmos avanzados, inspirados en el control de congestión TCP, para detectar automáticamente el límite de concurrencia óptimo y evitar que el servicio se sature. No es solo reintentar, es reintentar de forma inteligente para no colapsar un servicio ya sobrecargado.

En resumen, Resilience4j nos ayuda a ser más resistentes a fallos transitorios, mientras que concurrency-limits nos permite ser más eficientes y evitar el colapso del sistema en primer lugar.
The LinkedBlockingDeque has an interesting feature in addAll(), where they first build up the linked nodes and then add them all to the tail. However, a bug allowed us to overflow the size, resulting in a negative count. In this newsletter we look at this bug, and also how it was fixed in Java 26

.

https://javaspecialists.eu/archive/Issue328-Negative-size-in-LinkedBlockingDeque.html
📢 Kotlin 2.3.0-Beta2 is out! Here are some of the highlights:
Language: more stable and default features, a new checker for unused return values, and changes to context-sensitive resolution.
Kotlin/JVM: support for Java 25.
Kotlin/Native: improved interop through Swift export and type checks on generic type boundaries enabled by default.
Kotlin/Wasm: fully qualified names and new exception handling proposal enabled by default.
Kotlin/JS: new experimental suspend function export and LongArray representation.
Gradle: compatibility with Gradle 9.0 and a new API for registering generated sources.
Standard library: stable time tracking functionality.
Try it out: ➡️kotl.in/2-3-0-beta2



Source: https://x.com/kotlin/status/1983129735669399598
Para quienes trabajan con Kotlin y necesitan generar documentación de API, Dokka es el motor de documentación de referencia. Funciona con KDoc (Kotlin) y Javadoc (Java).

📃Puede generar la documentación en HTML moderno, varios tipos de Markdown y el Javadoc HTML clásico.

📚Es la herramienta utilizada por bibliotecas importantes del ecosistema como kotlinx.coroutines, Ktor y OkHttp.

🔗 https://kotl.in/dokka
https://inside.java/2025/11/03/quality-heads-up/
----------------------------
Change in JDK 25

JDK 25 fixed this long-standing inconsistency and new File("") now properly represents the current user directory:
To bring order to this chaos, at JetBrains Research we built LitmusKt — a novel testing tool for Kotlin’s multiplatform concurrency. Designed specifically for Kotlin’s unique mix of JVM, Native, and JavaScript backends, LitmusKt helps developers uncover and eliminate subtle, platform-specific concurrency errors that traditional testing can’t catch

.

https://blog.jetbrains.com/research/2025/10/litmuskt-concurrency-testing/
[JavaSpecialists 331] - Virtual Thread States

No major feature has been adopted as quickly into production systems as virtual threads. Not generics. Not streams. But there are some catches. Original Java threads have six states. Virtual threads have 20 states, which Java maps onto the original six states. However, sometimes it can be useful to know what the virtual threads state is. In this newsletter we use deep reflection to learn how that works



https://www.javaspecialists.eu/archive/Issue331-Virtual-Thread-States.html