Sobes.tech
Junior — Middle

Tell me about the most important problem you faced in your last project and how you solved it.

sobes.tech AI

Answer from AI

In one of my recent Java projects, I encountered a memory leak issue caused by improper management of object lifecycles in a multithreaded application. The application gradually slowed down and eventually crashed with an OutOfMemoryError.

To resolve this, I used memory profiling with VisualVM to identify which objects were not being released. It turned out that threads were being created but not properly terminated, and references to them were being kept in collections.

I reviewed the thread management logic, added proper termination and collection cleanup, and also implemented a thread pool (ExecutorService) to control thread creation and destruction. After that, the problem disappeared, and the application started working stably.