Skip to main content

Calling C from Java with jextract and the FFM API: A Real Library, No JNI

A jextract FFM example on a real library: generate SQLite bindings on JDK 25, understand the four arena kinds, move C strings and pointer-to-pointer out-parameters, turn return codes into exceptions, pass a Java lambda as a callback, and see how FFM compares with hand-written JNI in a JMH run.

Spring AI with Docker Model Runner vs Ollama: Local LLMs Benchmarked on the Same Laptop

Point one Spring AI 2.0.2 OpenAiChatModel at Docker Model Runner and at Ollama by changing only base-url and the model name. Same GGUF model, same prompts: decode speed, time to first token, container memory and tool-call success, with transcripts. Measured on a CPU-only shared sandbox with the real docker/model-runner image; GPU and Docker Desktop paths were not measured and the post says so.

Export Excel and CSV from Spring Boot: Streaming 1 Million Rows with Apache POI SXSSF

Export Excel from Spring Boot without running out of memory: XSSF vs SXSSF measured under a fixed heap (XSSF dies between 50,000 and 100,000 rows in 512 MB), 1,000,000 rows streamed with StreamingResponseBody under 64 MB, sheet rolling at 1,048,576 rows, temp-file cleanup, OpenCSV traps and a file LibreOffice will not open.

Spring AI + Spring Batch: Classifying 100,000 Support Tickets with an LLM (Throttling, Retries, Cost)

A Spring Batch 6 chunk step calls a Spring AI ChatClient for 100,000 generated support tickets. Resilience4j rate limiting and retry, skip-and-record for malformed JSON, a restart after kill -9 in a second JVM that ends byte-identical, and a per-chunk cost ledger, all run against a deterministic simulated model with every number taken from a committed transcript.

LRU Cache in Java: LinkedHashMap, HashMap + Doubly Linked List and a Thread-Safe Version

Three ways to build an LRU cache in Java: LinkedHashMap with accessOrder, HashMap plus a hand-rolled doubly linked list with sentinels, and thread-safe variants (synchronized, ReentrantLock, striping). Includes an O(1) dry-run table, a demo of why ReadWriteLock corrupts the list, a stress test with real assertions, an indicative JMH comparison and Caffeine as the production answer.