Answer:
Thread leak is when application does not release references of the thread object and those threads do not get garbage collected.
Number of such unused threads increases with time and it can cause issues in the application like long response time.
To overcome this problem we can do the following
1. By maintaining a log for all entry and exit point of thread.
2. Check how the new thread is created and how it is closed.
3. By using exception handling etc.
Number of such unused threads increases with time and it can cause issues in the application like long response time.
To overcome this problem we can do the following
1. By maintaining a log for all entry and exit point of thread.
2. Check how the new thread is created and how it is closed.
3. By using exception handling etc.
Previous Question | Next Question |
What is daemon thread and how it differs from user thread? | Explain the method of Thread class with example? |