Friday, October 27, 2023

Thread


  • Native Thread
  • Demon Thread
  • Non-Demon Thread
Native Thread: - Any Method/Thread which is mapped to OS is called Native Thread or Method.
Demon Thread:- Created by JVM(JVM will not wait for finish their work).
Non-Demon Thread :- Created by Application. (The Main Thread is always Non-Demon thread).
Thread Problems :-  These are the things happens at Application server side. and in these situations, we will take Thread Dump and analyze issues.
    • Application Server Freezes
    • Application Server unresponsiveness
    • Application server Crash or Hang
    • Application Server CPU is 100% High load
    • GC is crashing.
    • Slow Performance due to high Response Time
    • Server performance problems with API calls
    • Hang Threads
    • Server restarts
Thread States :-
    New
    Running ---> High CPU issues
    Waiting
    Timed waiting
    Blocked  --> Application Unresponsiveness
    Terminated
Thread Including :-
    Thread name
    Thread Type & Priority
    Thread ID
    Native Thread ID
    Java Thread stack Trace
    Java Heap breakdown
Counters :-
    Live Threads
    Peak Threads
    Demon Threads
    Total Started Threads

Thread Contentions or Resource Contention
User Threads & Kernal Threads
Deadlocks
Multi Threading
Thread Concurrency
Thread Dump
Single Thread & Multi Thread
Thread Pool Size

Thread Count
Thread State
Thread Group
Thread Execution
Thread Patterns

Daemon Thread :- Created by JVM (JVM will not wait for finish Their work)
Non-Daemon Thread :- Created by Application (The Main Thread is always Non-Daemon Thread).
Native Thread :- Any Thread which is mapped to OS that is called Native Thread.
Resource or Thread Contention :-  where Two or More threads are fighting with same resources.
if you have more number of waiting threads, then there is too much of Resource Contention.

Note : When CPU Utilization is more not coming down then take two Thread Dumps with 10sec gap eg : Dump1 and Dump2 

Thread

Native Thread Demon Thread Non-Demon Thread Native Thread: - Any Method/Thread which is mapped to OS is called Native Thread or Method. Demo...