Java™ 19 & 20. What's new and noteworthy?
summary
Demos show concrete outcomes: platform threads hit OOM around ~32,000 while virtual threads scale to millions (40k and a million tested), but code must recompile to use them and blocking inside synchronized methods pins carrier threads causing slowdowns. A Testcontainers + toxic‑proxy lab reproduces pinning, structured concurrency gives automatic cancellation across forks, pattern‑matching + record patterns shorten data handling, and the foreign memory API lets Java call libc getuid (down/up calls) and manage native memory segments/arenas. Java 19/20 features are shown with runnable examples.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:04Java 19 and 20 overview
- 7:03Why use latest Java
- 12:23Virtual threads introduction
- 27:54Virtual threads demo
- 33:32Virtual threads limitations
- 44:25Structured concurrency
- 53:26Scope values
- 1:02:00Pattern matching for switch
- 1:16:33Record patterns
- 1:29:16Foreign memory API
- 1:41:01Java 20 features summary
- 1:48:44Q&A and conclusion








