<div dir="ltr"><div><div>Hi,<br><br></div>Our Erlang Application hit an high slab cache memory issue.  Check the free command and slabtop command, the reason is that proc_inode_cache (means lots of inode in /proc)  consume lots of memory.<br><br></div><b>*  free command</b><br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">$ free -m<br>             total       used       free     shared    buffers     cached<br>Mem:          3697       3300        397          0        362        118<br>-/+ buffers/cache:       2819        877<br>Swap:            0          0          0<br></blockquote><div><br></div><div><b>* slabtop </b><br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"> Active / Total Objects (% used)    : 5436406 / 5679810 (95.7%)<br> Active / Total Slabs (% used)      : 234780 / 234780 (100.0%)<br> Active / Total Caches (% used)     : 65 / 101 (64.4%)<br> Active / Total Size (% used)       : 2135436.95K / 2161607.05K (98.8%)<br> Minimum / Average / Maximum Object : 0.01K / 0.38K / 8.00K<br><br>  OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME<br>2609313 2609313 100%    0.19K 124253       21    497012K dentry<br>2503826 2503826 100%    0.61K  96301       26   1540816K proc_inode_cache<br></blockquote><div><br></div><div> And check the Erlang VM, it has 323 threads.  An interesting thing, all thread will open almost same number of sockets.<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">$ ls -lht /proc/13197/task/ |wc -l<br>323<br>$ ls -lht /proc/13197/task/13412/fd |wc -l<br>4776<br>$ ls -lht /proc/13197/task/13414/fd |wc -l<br>4791<br>$ ls -lht /proc/13197/task/13414/fd |head -10<br>total 0<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4245 -> socket:[2103438292]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4248 -> socket:[2103411552]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4364 -> socket:[2097429782]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4609 -> socket:[2103438164]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4610 -> socket:[2103438165]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4612 -> socket:[2103438175]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4613 -> socket:[2103438176]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4614 -> socket:[2103438177]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4615 -> socket:[2103438178]<br>$ ls -lht /proc/13197/task/13414/fd |head -10<br>total 0<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4248 -> socket:[2103411552]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4364 -> socket:[2097429782]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4630 -> socket:[2097238946]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4631 -> socket:[2097236427]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4632 -> socket:[2097236430]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4633 -> socket:[2097238953]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4635 -> socket:[2097238954]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4637 -> socket:[2097238956]<br>lrwx------ 1 yunba users 64 Dec 15 16:40 4639 -> socket:[2097238957] <div>$ ls -lht /proc/13197/task/*/fd |wc -l<br>1524804 <br></div></blockquote><div><br></div><div>If application operate a socket, will it be opened in every Erlang VM thread?<br><br></div><div>Thanks,<br></div><div>Linbo <br></div></div></div></div>