doc:appunti:linux:sa:linux_virtual_memory
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:linux:sa:linux_virtual_memory [2023/12/18 11:21] – niccolo | doc:appunti:linux:sa:linux_virtual_memory [2023/12/18 12:42] (current) – [Come rilasciare la cache] niccolo | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Linux Virtual Memory ====== | ====== Linux Virtual Memory ====== | ||
| + | |||
| + | ===== Diagnosi di Out of Memory Killer ===== | ||
| + | |||
| + | Come diagnosticare problemi //Out of Memory Killer//? Nel syslog si legge quanto segue: | ||
| + | |||
| + | < | ||
| + | kernel: apache2 invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), | ||
| + | order=0, oom_score_adj=0 | ||
| + | ... | ||
| + | kernel: Mem-Info: | ||
| + | kernel: active_anon: | ||
| + | kernel:  | ||
| + | kernel:  | ||
| + | kernel:  | ||
| + | kernel:  | ||
| + | kernel:  | ||
| + | ... | ||
| + | kernel: Tasks state (memory values in pages): | ||
| + | kernel: [  pid  ]    | ||
| + | kernel: [    279]      | ||
| + | ... | ||
| + | kernel: [2109336]  | ||
| + | kernel: [2109339]  | ||
| + | kernel: [2109340]  | ||
| + | ... | ||
| + | kernel: Out of memory: Killed process 1102 (mariadbd) total-vm: | ||
| + |         file-rss: | ||
| + | </ | ||
| + | |||
| + | Quindi una richiesta di allocazione memoria da parte del processo **apache2** ha causato il kill del processo **mariadbd**. Anche l' | ||
| + | |||
| < | < | ||
| Line 20: | Line 51: | ||
| ^ Active(file)  | ^ Active(file)  | ||
| + | ===== Come rilasciare la cache ===== | ||
| + | |||
| + | Per rilasciare le **PageCache** si può usare il comando: | ||
| + | |||
| + | < | ||
| + | sync; echo 1 > / | ||
| + | </ | ||
| + | |||
| + | Dovrebbero andare a zero diversi contatori, tra cui quello della **Active** memory. | ||
| + | |||
| + | Il parametro **1** scritto nello pseudofile può assumere valori diversi, a seconda di cosa si voglia rilasciare: | ||
| + | ^ 1  | Clears only the page cache.  | ||
| + | ^ 2  | Clears dentries and inodes.  | ||
| + | ^ 3  | Clears page cache, dentries, and inodes.  | ||
| ===== Web References ===== | ===== Web References ===== | ||
| Line 26: | Line 71: | ||
|   * **[[https:// |   * **[[https:// | ||
|   * **[[https:// |   * **[[https:// | ||
| + |   * **[[https:// | ||
doc/appunti/linux/sa/linux_virtual_memory.1702894866.txt.gz · Last modified:  by niccolo
                
                