Digiaru

In GUI or reactive code, I register listeners (e.g. property change, lifecycle events) but forget to unregister them. Over time, unused components aren’t garbage-collected and performance degrades. Why?

Digiaru posted 3 months ago

Digiaru

In my web app, I use ThreadLocal to store request metadata per thread. Over time, memory use steadily grows—even though threads finish processing. What's wrong?

Digiaru posted 3 months ago

Digiaru

I'm using a shared Counter class with counter++ in a multithreaded Java app. Despite starting 100 threads each calling increment() 1000 times, the final count often falls far short of 100,000. Why?

Digiaru posted 3 months ago

Kar

My useEffect either never runs when expected, or runs too often—even infinitely—because of incorrectly specified dependencies or updates inside the effect.

Kar posted 3 months ago

Kar

I register a window resize listener or interval in useEffect but forget to clean it up. Over time, event handlers pile up or continue after unmounting, causing performance issues.

Kar posted 3 months ago

Kar

Context provider value defined inline causes every consumer to re-render on any state change—even if the specific value consumed didn't change.

Kar posted 3 months ago

Kar

Inside a useEffect, I use state variables or functions that seem “frozen” even after updates. For example, a counter set by interval never increments past the initial value.

Kar posted 3 months ago

Kar

I have: jsx Copy code const tasks = []; useEffect(() => { fetchTasks().then(setTasks); }, [tasks]); This causes continuous fetching and rendering—even when tasks appear unchanged. Why?

Kar posted 3 months ago

Digiaru

I conditionally call a hook inside an if statement, expecting it not to run when condition fails. But React throws errors about hook order.

Digiaru posted 3 months ago

Digiaru

React component consumers re-render too frequently—even when their local state didn’t change—because the Context provider’s value object changes each render.

Digiaru posted 3 months ago

Digiaru

I register a window event listener inside useEffect, but never remove it. This causes memory leaks and duplicate behavior when the component unmounts and remounts.

Digiaru posted 3 months ago

Digiaru

A component re-renders endlessly because useEffect fetch logic keeps running—despite no obvious changes.

Digiaru posted 3 months ago

Digiaru

I set up an interval inside useEffect to update a counter, but the counter remains static (always zero). Why?

Digiaru posted 3 months ago

Digiaru

In a web server using thread pools, I store request metadata in a ThreadLocal. Over time memory use grows, even though threads return to the pool. What’s causing this leak?

Digiaru posted 3 months ago

Digiaru

When I update my Java class (add/remove fields) and try to deserialize older serialized objects, I get InvalidClassException. Additionally, some transient fields appear null unexpectedly after deserialization. What’s going wrong?

Digiaru posted 3 months ago

Digiaru

In Java GUI or event-driven code, I register listeners or observers on long-lived objects but never explicitly unregister them. Over time memory usage creeps up, and objects stuck in those listeners aren’t garbage collected. How do I fix this?

Digiaru posted 3 months ago

Kar

Occasionally threads in my Java app hang without warning. Stack traces show each waiting on a lock held by the other. What's causing this deadlock and how can I resolve it?

Kar posted 3 months ago

Kar

When multiple threads concurrently write to a shared HashMap, my Java application occasionally freezes or throws OutOfMemoryError. The issue is intermittent and hard to replicate.

Kar posted 3 months ago

Kar

In a multi-threaded Java application, I have a worker thread that repeatedly sleeps in a loop. When another thread interrupts it, the interrupt is ignored, and the worker continues running indefinitely. How can I fix this to allow proper interruption...

Kar posted 3 months ago

Digiaru

I used Java's parallelStream() for processing large lists. Unexpected behavior occurred—incorrect results or OutOfMemoryError. What went wrong?

Digiaru posted 3 months ago

Showing 181 to 200 of 755 results