🧠 Engineering With Java: Digest #72 — Key Points Top articles this week: - Java warmup & scaling loop issue — How JIT warmup spikes CPU and triggers autoscaling loops in cloud environments; practical ways to mitigate it. - Spring Boot request logging with redaction — Implement filters to log requests safely by masking sensitive fields. - Intro to Apache IoTDB (Time-Series DB) — Basics of using IoTDB with Java via JDBC for timestamped data. - Quarkus for cloud-native Java — How Quarkus boosts dev productivity, runtime performance, and Kubernetes friendliness. - JVM performance engineering — Tips on GC choices (G1, ZGC, Shenandoah) and tuning for high-demand services. - Istio Spring Boot integration — New library for easier service-mesh setup via annotations. - Automating unused code removal — Using Azul monitoring + OpenRewrite to safely prune dead Java code in large codebases. - Run TensorFlow in Java 25 w/o JNI — Use Foreign Function & Memory API to run native TensorFlow from Java. - Spring SQL arrays with JdbcClient — Cleanly bind IN (?) array parameters in SQL using new API. Read the newsletter: https://lnkd.in/g8S2cNGR #java #spring #springboot
Java Digest #72: JIT Warmup, Spring Boot Logging, IoTDB, Quarkus, JVM Performance
More Relevant Posts
-
🧠 Engineering With Java: Digest #72 — Key Points Top articles this week: - Java warmup & scaling loop issue — How JIT warmup spikes CPU and triggers autoscaling loops in cloud environments; practical ways to mitigate it. - Spring Boot request logging with redaction — Implement filters to log requests safely by masking sensitive fields. - Intro to Apache IoTDB (Time-Series DB) — Basics of using IoTDB with Java via JDBC for timestamped data. - Quarkus for cloud-native Java — How Quarkus boosts dev productivity, runtime performance, and Kubernetes friendliness. - JVM performance engineering — Tips on GC choices (G1, ZGC, Shenandoah) and tuning for high-demand services. - Istio Spring Boot integration — New library for easier service-mesh setup via annotations. - Automating unused code removal — Using Azul monitoring + OpenRewrite to safely prune dead Java code in large codebases. - Run TensorFlow in Java 25 w/o JNI — Use Foreign Function & Memory API to run native TensorFlow from Java. - Spring SQL arrays with JdbcClient — Cleanly bind IN (?) array parameters in SQL using new API. Read the newsletter: https://lnkd.in/g8S2cNGR #java #spring #springboot
To view or add a comment, sign in
-
Hello Java Developers, 🚀 Day 8 – Java Revision Series Today’s topic goes one level deeper into Java internals and answers a fundamental question: ❓ Question How does the JVM work internally when we run a Java program? ✅ Answer The Java Virtual Machine (JVM) is responsible for executing Java bytecode and providing platform independence. Internally, the JVM works in well-defined stages, from source code to machine execution. 🔹 Step 1: Java Source Code → Bytecode .java → javac → .class Java source code is compiled by the Java Compiler (javac) Output is bytecode, not machine code Bytecode is platform-independent 🔹 Step 2: Class Loader Subsystem The JVM loads .class files into memory using the Class Loader Subsystem, which follows a parent-first delegation model. Types of Class Loaders: Bootstrap Class Loader – loads core Java classes (java.lang.*) Extension Class Loader – loads extension libraries Application Class Loader – loads application-level classes This ensures: Security No duplicate core classes Consistent class loading 🔹 Step 3: Bytecode Verification Before execution, bytecode is verified to ensure: No illegal memory access No stack overflow/underflow Type safety 🛡️ This step protects the JVM from malicious or corrupted bytecode. 🔹 Step 4: Runtime Data Areas Once verified, data is placed into JVM memory areas: Heap – objects and instance variables Stack – method calls, local variables Method Area / Metaspace – class metadata PC Register – current instruction Native Method Stack – native calls This is where your program actually lives during execution. 🔹 Step 5: Execution Engine The Execution Engine runs the bytecode using: Interpreter – executes bytecode line by line JIT Compiler – converts frequently executed bytecode into native machine code for performance This is how Java achieves both portability and speed. 🔹 Step 6: Garbage Collector The JVM automatically manages memory by: Identifying unreachable objects Reclaiming heap memory Managing Young and Old Generations GC runs in the background, improving reliability and developer productivity. #Java #CoreJava #JVM #JavaInternals #GarbageCollection #MemoryManagement #LearningInPublic #InterviewPreparation
To view or add a comment, sign in
-
-
🚀 Java Records Explained — Write Less, Say More (Java 16+) If you’ve ever written a POJO in Java and thought “Why am I writing the same boilerplate code again?” 👉 Java Records are the answer. Introduced officially in Java 16, Records are a special kind of Java class designed for one purpose only: 🧠 Act as a plain, immutable data carrier 🔍 What Are Java Records? A Java Record is a concise syntax for declaring classes whose main role is to store data. Instead of manually writing: fields constructors getters equals() hashCode() toString() 👉 the Java compiler generates everything for you automatically. ✅ Immutable Fields All fields are final. Once created → state cannot change ✅ Canonical Constructor Auto-generated constructor initializes all components ✅ Built-in Methods equals(), hashCode(), toString() come for free ✅ Clean Accessors No getX() → just point.x() ✅ Final Class Records cannot be extended → safer design 💡 Syntax Comparison (The Real Power) ❌ Traditional Java Class (Boilerplate Heavy) public class Point { private final int x; private final int y; public Point(int x, int y) { this.x = x; this.y = y; } public int x() { return x; } public int y() { return y; } // equals(), hashCode(), toString()... } ✅ Java Record (Clean & Expressive) public record Point(int x, int y) {} 📉 ~30 lines → 1 line 📈 Readability + Maintainability 🎯 When Should You Use Java Records? Java Records shine when data is the hero: ✔ DTOs (Data Transfer Objects) ✔ REST API Responses (Spring Boot) ✔ Kafka / Event Payloads ✔ Immutable Configuration Objects ✔ Keys in HashMap / HashSet ✔ Microservices Communication 🧠 Why Java Records Matter in Real-World Systems Reduce boilerplate in enterprise Java Encourage immutability & safer code Improve developer productivity Align perfectly with modern Java design 👉 Records are not just syntax sugar — they’re a design philosophy shift. If this helped you 👇 👍 Like | 💬 Comment | 🔁 Repost
To view or add a comment, sign in
-
-
Interesting post by Emanuel Trandafir about how to generate an Avro schema from a given Java class https://lnkd.in/dJprbV_X #java #spring #springboot #avro
To view or add a comment, sign in
-
🚀 Java Frameworks Evolution: Java 8 to Java 21 ✨ JAVA 8 (2014) Spring Framework 4.x introduced Lambda expressions, Stream API, and functional programming. This revolutionized how we process data - stream().filter().map().collect() became the standard pattern. Impact: Reduced boilerplate code, enabled reactive programming foundations, better performance in data-intensive applications. 💪 JAVA 11-17 (2018-2021) Spring Boot 2.x matured with cloud-native features. Spring Cloud emerged as essential: • Service Discovery (Eureka, Consul) • Circuit Breaker patterns (Resilience4j) • Distributed tracing (Sleuth + Zipkin) • API Gateway implementation Java 9-11: Modules (Project Jigsaw), var keyword, improved GC Java 17 LTS: Sealed classes, pattern matching, GraalVM support 🎯 JAVA 21 (2023) - The Game Changer Spring Boot 3.x & Spring Framework 6.x with groundbreaking features: 🔹 Project Loom (Virtual Threads) • Lightweight threads - handle millions instead of thousands • Traditional blocking I/O becomes scalable • db.query() doesn't block platform threads anymore • Performance: 100 connections = 100 threads → 100,000 connections = few threads 🔹 Project Panama (FFM API) • Direct C/C++ library calls without JNI • Better native performance and I/O optimization 🔹 Spring Native Compilation • GraalVM native binaries • Startup: 5-10s → 500ms • Memory: 512MB-2GB → 50-100MB • Perfect for serverless and Kubernetes 📊 Real Numbers: Java 8 vs Java 21 (native): • Startup: ~8s → ~500ms (94% faster) • Memory: 1GB → 100MB (90% reduction) • Container boot time: Dramatic improvement for orchestration 🤔 Questions for You: 1. What Java version runs your production apps? 2. Experienced with GraalVM native images? 3. Ready to adopt virtual threads for I/O services? 4. Spring Boot 3.x migration plans? Migration path: - Java 8→11: Dependency updates, module system - Java 11→17: Spring Boot 2.7+, sealed classes exploration - Java 17→21: Spring Boot 3.x mandatory, virtual threads adoption recommended The future is clearly virtual threads + native compilation. What's stopping your team from upgrading? #Java #JavaDeveloper #SpringBoot #BackendDevelopment #Microservices #CloudNative #VirtualThreads #GraalVM #SoftwareArchitecture
To view or add a comment, sign in
-
🚀 Java Daily Series | Day 2/100 ☕ ✨ Understanding the basics clearly makes everything easier later. 📘 Day 2 – JDK Installation & Java Boilerplate (First Program Explained) Today I focused on setting up Java and deeply understanding the structure of a Java program, also known as Java boilerplate code. This is the foundation that every Java developer must be clear about. 🔹 JDK Installation To write and run Java programs, we need the JDK (Java Development Kit). The JDK includes: JVM (Java Virtual Machine) – Executes bytecode JRE (Java Runtime Environment) – Provides runtime support javac compiler – Converts .java files into .class bytecode After installation, we verify it using: java -version 🔹 Java Boilerplate Code – Why It Matters Every Java program follows a fixed structure. Understanding why each keyword is used helps in writing clean and error-free code. 📌 The diagram explains: public → Access modifier that allows JVM to access the class/method class → Java programs are built using classes Class Name → Should match the filename main() method → Entry point of the program static → Allows JVM to call the method without creating an object void → No return value String[] args → Used to receive command-line arguments System.out.println() → Prints output to the console Each keyword has a specific purpose, not just syntax to memorize. 🔹 Program Execution Flow Write source code (.java) Compile using javac → bytecode (.class) JVM loads the bytecode Interpreter executes it JIT compiler optimizes performance Output is displayed Strong understanding of boilerplate code builds confidence in Java and makes advanced topics like OOP, collections, and frameworks much easier. #JavaDeveloper #100DaysOfJava #JavaBasics #CoreJava #LearningInPublic #Programming #CodingJourney #SoftwareDevelopment #Meghana M #10000 Coders
To view or add a comment, sign in
-
Annotations in Java Do vs Don’t ⚠️ Annotations are powerful. But they are often misunderstood. This Do vs Don’t cheat sheet summarizes what actually works in real Java systems 👇 ✅ DO Use Annotations Correctly: • Use annotations to express intent • Treat annotations as hints to frameworks, not guarantees • Combine annotations with explicit logic • Understand where and when annotations apply • Keep validation and rules close to the code Annotations help frameworks help you. ❌ DON’T Common Mistakes: • Don’t assume annotations enforce correctness • Don’t rely on annotations for business rules • Don’t assume they always work at runtime • Don’t treat annotations as a replacement for testing • Don’t ignore execution paths and configuration Annotations can be bypassed more easily than most teams realize. 🧠 Simple mental model Annotations answer: 👉 How should the framework treat this code? They do not answer: 👉 Is this code correct? 🔑 Golden rule Annotations support correctness. They do not enforce it. Correctness still comes from: • clear boundaries • explicit validation • careful design • predictable control flow Annotations reduce boilerplate. They improve readability. But responsibility still lives in code, not metadata. 👇 Which annotation do you see most misunderstood in real projects? #Java #JavaIn2026 #CleanCode #SoftwareEngineering #BackendDevelopment
To view or add a comment, sign in
-
-
📌 Ignoring memory is the fastest way to write slow Java code. 🗓️ Day2/21 – Mastering Java 🚀 Topic: Java Memory Model | Heap vs Stack To build scalable backend systems and debug issues like memory leaks, GC pauses, or runtime errors, it’s important to understand how Java manages memory at runtime. 🔹 Java Memory Model (JMM) The Java Memory Model defines how variables are stored in memory and how threads interact with them. It ensures visibility, ordering, and consistency across threads in multithreaded applications. 🔹 Stack Memory: - Stack memory is used for method execution and local variables. - Stores method calls, local variables, and references. - Allocated per thread and very fast. - Follows LIFO (Last In, First Out) - Automatically cleaned after method execution 📌 Common issue: StackOverflowError (deep or infinite recursion) 🔹 Heap Memory - Heap memory is used for object storage. - Stores objects and class instances. - Shared across threads. - Managed by the JVM. - Cleaned automatically by Garbage Collection. 📌 Common issue: OutOfMemoryError (memory leaks or excessive object creation) 🔹 Heap vs Stack (Quick Comparison) Stack → References & method data. Heap → Actual objects. Stack is thread-safe and faster. Heap is larger and shared. 💡 Top 3 Frequently Asked Java Interview Questions (From today’s topic) 1️: Where are objects and references stored in Java? 2️: Why is Stack memory thread-safe but Heap is not? 3️: Difference between OutOfMemoryError and StackOverflowError? 💬 Share your answers or questions in the comments — happy to discuss! #21DaysOfJava #JavaMemoryModel #HeapVsStack #Java #HeapMemory #StackMemory #JMM
To view or add a comment, sign in
-
🚀 Java Records: A Cleaner Way to Write DTOs Java introduced Records to reduce boilerplate code and make data-centric classes simpler and more readable. 🔹 What is a Record? A record is a special type of class introduced as a preview in Java 14 (finalized in Java 16) and is designed to store immutable data. It is perfect for DTOs (Data Transfer Objects) where we only need to carry data without business logic. 🔹 Why use Records? ✅ Less boilerplate code ✅ Immutable by default ✅ Auto-generated constructor, equals(), hashCode(), and toString() ✅ Clear intent: “this class is just data.” 🔹 DTO without Record (Traditional Way) public class UserDto { private final Long id; private final String name; private final String email; public UserDto(Long id, String name, String email) { this.id = id; this.name = name; this.email = email; } public Long getId() { return id; } public String getName() { return name; } public String getEmail() { return email; } } 🔹 DTO with Record public record UserDto(Long id, String name, String email) {} That’s it! 🎉 Java automatically generates: Constructor Getters (id(), name(), email()) equals() and hashCode() toString() 🔹 Traditional DTO vs Record 1. Traditional DTO → Lots of boilerplate code 2. Record DTO → One line, fully functional 3. When to Use Records? 4. API request/response DTOs 5. Immutable data transfer 6. Microservices communication 7. Avoid for JPA entities or mutable objects #Java #JavaRecords #Java14 #Java16 #DTO #SpringBoot #BackendDevelopment #CleanCode #Programming
To view or add a comment, sign in
-
🚀 Day 2 – Creating Threads & Understanding Execution Control in Java Today I focused on one of the most misunderstood yet critical concepts in Java Multithreading — how threads are actually created and how start() works internally. Understanding this difference is essential for writing scalable backend systems. 🔄 Two Ways to Create a Thread 1️⃣ Extending Thread Class • Override run() • Create object of class • Call start() 2️⃣ Implementing Runnable (Recommended Approach) • Implement Runnable interface • Override run() • Pass Runnable object to Thread • Call start() 💡 Why Runnable is Recommended? ✔ Supports multiple inheritance (since Java doesn’t allow extending multiple classes) ✔ Clear separation of task and execution mechanism ✔ Foundation of Executor Framework ✔ Cleaner architecture for scalable systems In real-world backend development, we rarely create raw threads manually. We use: • ThreadPool • ExecutorService • CompletableFuture / Async APIs Because uncontrolled thread creation can degrade performance or even crash production systems. 🚦 start() vs run() – A Critical Interview Concept This is one of the most common interview traps. If run() is called directly: • Executes inside current thread • No new thread is created • No parallel execution If start() is called: • Thread is registered with JVM • Required resources are allocated • New call stack is created • Internally invokes run() 👉 A new thread is created only when start() is called. Using run() instead of start() can silently break scalability. 🔎 Thread.currentThread() Thread.currentThread() returns the currently executing thread object. Used for: • Logging thread names in production • Debugging concurrency issues • Monitoring execution flow This becomes extremely useful in backend systems handling multiple concurrent requests. ⚙ Thread Properties We can modify: • setName(String) • setPriority(int) Important: Thread ID is assigned by JVM and is read-only. Meaningful thread naming in production helps trace issues faster. 🏗 Backend Perspective Imagine 1000 users hitting a login API simultaneously. If developer mistakenly uses run() instead of start(): • Application behaves like single-threaded • Throughput drops • Server load increases • Performance degrades Correct thread handling directly impacts backend scalability. 🎯 Key Interview Topics Covered • Runnable vs Thread – which is better and why? • Difference between start() and run() • What happens internally when start() is called? • Can a thread be started twice? • Why use thread pools in backend systems? 📌 Today’s Learning Concurrency design matters more than syntax. Backend performance depends on: • Correct thread creation • Proper execution control • Scalable concurrency management Still strengthening fundamentals to build better backend systems. 🚀 #Java #Multithreading #BackendDevelopment #Concurrency #Threading #InterviewPreparation #SoftwareEngineering #LearningJourney
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development