One of my servers are having problems with memory starvation, and are whacking off (mostly Java) processes to stay alive.
In order to debug the memory starvation issue I need a more thorough insight into how the memory management is done in Linux. Therefore it would be great if someone could provide a walkthrough of the essentails in the /var/log/messages extract provided below.
For example:
- How do the different memory zones work?
- What does it mean that memory is "all unreclaimable"?
I'm not completely new to this stuff, but would like an active discussion in order to get a more complete understanding.
Anyways, here's the log extract:
Mar 6 11:53:22 mercury kernel: oom-killer: gfp_mask=0xd2
Mar 6 11:53:22 mercury kernel: Mem-info:
Mar 6 11:53:22 mercury kernel: DMA per-cpu:
Mar 6 11:53:22 mercury kernel: cpu 0 hot: low 2, high 6, batch 1
Mar 6 11:53:22 mercury kernel: cpu 0 cold: low 0, high 2, batch 1
Mar 6 11:53:22 mercury kernel: cpu 1 hot: low 2, high 6, batch 1
Mar 6 11:53:22 mercury kernel: cpu 1 cold: low 0, high 2, batch 1
Mar 6 11:53:22 mercury kernel: Normal per-cpu:
Mar 6 11:53:22 mercury kernel: cpu 0 hot: low 32, high 96, batch 16
Mar 6 11:53:22 mercury kernel: cpu 0 cold: low 0, high 32, batch 16
Mar 6 11:53:22 mercury kernel: cpu 1 hot: low 32, high 96, batch 16
Mar 6 11:53:22 mercury kernel: cpu 1 cold: low 0, high 32, batch 16
Mar 6 11:53:22 mercury kernel: HighMem per-cpu:
Mar 6 11:53:22 mercury kernel: cpu 0 hot: low 32, high 96, batch 16
Mar 6 11:53:22 mercury kernel: cpu 0 cold: low 0, high 32, batch 16
Mar 6 11:53:22 mercury kernel: cpu 1 hot: low 32, high 96, batch 16
Mar 6 11:53:22 mercury kernel: cpu 1 cold: low 0, high 32, batch 16
Mar 6 11:53:22 mercury kernel:
Mar 6 11:53:22 mercury kernel: Free pages: 269900kB (512kB HighMem)
Mar 6 11:53:23 mercury kernel: Active:299042 inactive:231443 dirty:0 writeback:0 unstable:0 free:67475 slab:4698 mapped:530206 pagetables:2270
Mar 6 11:53:23 mercury kernel: DMA free:12524kB min:16kB low:32kB high:48kB active:0kB inactive:0kB present:16384kB pages_scanned:4444 all_unreclaimable? yes
Mar 6 11:53:23 mercury kernel: protections[]: 0 116000 180000
Mar 6 11:53:23 mercury kernel: Normal free:256864kB min:928kB low:1856kB high:2784kB active:17224kB inactive:16292kB present:901120kB pages_scanned:2406355 all_unreclaimable? yes
Mar 6 11:53:23 mercury kernel: protections[]: 0 0 64000
Mar 6 11:53:23 mercury kernel: HighMem free:512kB min:512kB low:1024kB high:1536kB active:1178816kB inactive:909480kB present:4325376kB pages_scanned:7454098 all_unreclaimable? yes
Mar 6 11:53:23 mercury kernel: protections[]: 0 0 0
Mar 6 11:53:23 mercury kernel: DMA: 3*4kB 4*8kB 2*16kB 3*32kB 3*64kB 3*128kB 2*256kB 0*512kB 1*1024kB 1*2048kB 2*4096kB = 12524kB
Mar 6 11:53:23 mercury kernel: Normal: 146*4kB 25*8kB 17*16kB 6*32kB 2*64kB 2*128kB 5*256kB 10*512kB 1*1024kB 1*2048kB 60*4096kB = 256864kB
Mar 6 11:53:23 mercury kernel: HighMem: 20*4kB 6*8kB 0*16kB 0*32kB 0*64kB 1*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 512kB
Mar 6 11:53:23 mercury kernel: Swap cache: add 12442227, delete 12441204, find 4256249/5650043, race 5+249
Mar 6 11:53:23 mercury kernel: 0 bounce buffer pages
Mar 6 11:53:23 mercury kernel: Free swap: 0kB
Mar 6 11:53:23 mercury kernel: 1310720 pages of RAM
Mar 6 11:53:23 mercury kernel: 1015792 pages of HIGHMEM
Mar 6 11:53:23 mercury kernel: 77337 reserved pages
Mar 6 11:53:23 mercury kernel: 6895 pages shared
Mar 6 11:53:23 mercury kernel: 1023 pages swap cached
Mar 6 11:53:23 mercury kernel: Out of Memory: Killed process 18552 (java).
Regards,
kenneho