# Diagnosis Method For Tidb Server OOM (A)

+ Client applications

+ logs
  + `dmesg -T` | `grep tidb-server` In the results, there is a OOM-killer log of the time near the accident
  + `tidb.log`(Incident happened around "Welcome to TiDB" record < when TiDB server got restarted>
  + `tidb_stderr.log` ( grep to fatal error : "runtime: out of memory" or "cannot allocate memory" )
```
ERROR 2013 (HY000): Lost connection to MySQL server during query
```
-------------------------------------------------------------
- We can confirm whether OOM occurs in the following ways:
- Client
   - Normally, the client will receive an error from the TiDB server
      “ERROR 2013 (HY000): Lost connection to MySQL server during query”
- log
   - operating system
     - dmesg -T | grep tidb-server The result contains the log of the OOM-killer at the time point near the accident.
   - tidb.log
     - grep the message "Welcome to TiDB" at the time near the accident (that means the TiDB server restarted).
   - tidb_stderr.log
     - grep the message "runtime: out of memory" or "cannot allocate memory"  which stands for the fatal error.

