Tagged articles
11 articles
Page 1 of 1
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Dec 24, 2025 · Fundamentals

Understanding Java’s final, finally, and finalize: Usage, Pitfalls, and Best Practices

This article explains the distinct purposes of Java's final keyword, finally block, and finalize method, shows how to use them with classes, methods, and variables, highlights scenarios where finally may not run, discusses finalize deprecation, and recommends modern resource‑management techniques like try‑with‑resources.

Exception HandlingJavaResource Management
0 likes · 5 min read
Understanding Java’s final, finally, and finalize: Usage, Pitfalls, and Best Practices
Java Backend Technology
Java Backend Technology
Mar 28, 2021 · Backend Development

Hidden Java Memory Leaks: 8 Common Pitfalls and How to Fix Them

This article explains eight typical Java memory‑leak scenarios—including unclosed resources, missing equals/hashCode, non‑static inner classes, overridden finalize, String.intern misuse, ThreadLocal traps, and static variables in web containers—provides code examples for each, and offers practical mitigation strategies.

Garbage CollectionJavaThreadLocal
0 likes · 11 min read
Hidden Java Memory Leaks: 8 Common Pitfalls and How to Fix Them
Programmer DD
Programmer DD
Dec 11, 2020 · Backend Development

Why Does Executors.newSingleThreadExecutor Shut Down Unexpectedly? Uncovering GC and Finalize Mysteries

This article investigates the intermittent RejectedExecutionException caused by Executors.newSingleThreadExecutor, explains how Java's garbage collector and finalize method can prematurely shut down thread pools, demonstrates the behavior with reproducible code, and shows how newer JDK versions have fixed the issue.

GarbageCollectionJavaThreadPool
0 likes · 11 min read
Why Does Executors.newSingleThreadExecutor Shut Down Unexpectedly? Uncovering GC and Finalize Mysteries
Didi Tech
Didi Tech
Mar 28, 2019 · Mobile Development

Analysis and Mitigation of Android finalize() TimeoutException Crashes

The article examines Android crashes caused by the finalize() method exceeding its watchdog timeout, explains the underlying daemon implementation and typical causes such as long‑running finalizers, lock contention and low‑priority threads, and recommends avoiding finalize, reducing finalizable objects, or suppressing the watchdog exception as practical mitigations.

AndroidCrashTimeoutException
0 likes · 15 min read
Analysis and Mitigation of Android finalize() TimeoutException Crashes