<font size=2 face="sans-serif">Hi Jason,</font>
<br>
<br><font size=2 face="sans-serif">Thx for taking the time to look into
this !</font>
<br>
<br><font size=2 face="sans-serif">Below is the requested information.
 When I originally observed this behavior I was running with munmap
disabled.  We are currently running with it enabled, to see how much
it helps or hurts us.  Private_Clean is still high with munmap enabled,
however our processes RSS seems to be growing slower.</font>
<br>
<br><font size=2 face="sans-serif">Also, we have swapping disabled.  Mainly
because we are running a bunch of java processes for which we don't want
any of the JVM to ever be swapped.  It's unclear if enabling swap
will help us avoid the OS OOM killer, however we will soon be running some
experiments with swap enabled.</font>
<br>
<br><font size=2 face="sans-serif">I've been try to catch strace when the
Private_Clean is growing.  Not sure if you are asking for a full strace
or whether the summary is good enough.  A full strace would be way
too large as our server is under full load with tens of thousands of allocations
every second.  The summary is attached below for a 30 minute duration,
during which time I observed a single smap grow by 100MB of private clean
pages.  Over the next couple of hours it didn't grow at all, rather
it shrunk by a couple of hundred MBs.</font>
<br>
<br><font size=2 face="sans-serif">Please let me know if anything else
is needed, or if you have any suggestions with other jemalloc config options
or Linux tuning we maybe able to do to help.  THX !</font>
<br>
<br><font size=2 face="sans-serif">1) Linux version:</font>
<br>
<br><font size=2 face="sans-serif">Linux 10.42.229.68 2.6.32-131.21.1.89.br5_0.x86_64
#1 SMP Tue Mar 19 15:05:57 CDT 2013 x86_64 GNU/Linux</font>
<br>
<br><font size=2 face="sans-serif">2) config options for jemalloc:</font>
<br>
<br><font size=2 face="sans-serif">===============================================================================</font>
<br><font size=2 face="sans-serif">jemalloc version   : 3.3.1-0-g9ef9d9e8c271cdf14f664b871a8f98c827714784</font>
<br><font size=2 face="sans-serif">library revision   : 1</font>
<br>
<br><font size=2 face="sans-serif">CC          
      : gcc</font>
<br><font size=2 face="sans-serif">CPPFLAGS        
  :  -D_GNU_SOURCE -D_REENTRANT</font>
<br><font size=2 face="sans-serif">CFLAGS          
  : -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops</font>
<br><font size=2 face="sans-serif">LDFLAGS        
   : </font>
<br><font size=2 face="sans-serif">LIBS          
    :  -lm -lpthread</font>
<br><font size=2 face="sans-serif">RPATH_EXTRA        :
</font>
<br>
<br><font size=2 face="sans-serif">XSLTPROC        
  : /usr/bin/xsltproc</font>
<br><font size=2 face="sans-serif">XSLROOT        
   : /usr/share/sgml/docbook/xsl-stylesheets</font>
<br>
<br><font size=2 face="sans-serif">PREFIX          
  : /root/kWebSphere/workspace/XS3/XS/ws/code/prereq.jemalloc</font>
<br><font size=2 face="sans-serif">BINDIR          
  : /root/kWebSphere/workspace/XS3/XS/ws/code/prereq.jemalloc/bin</font>
<br><font size=2 face="sans-serif">INCLUDEDIR        
: /root/kWebSphere/workspace/XS3/XS/ws/code/prereq.jemalloc/include</font>
<br><font size=2 face="sans-serif">LIBDIR          
  : /root/kWebSphere/workspace/XS3/XS/ws/code/prereq.jemalloc/lib</font>
<br><font size=2 face="sans-serif">DATADIR        
   : /root/kWebSphere/workspace/XS3/XS/ws/code/prereq.jemalloc/share</font>
<br><font size=2 face="sans-serif">MANDIR          
  : /root/kWebSphere/workspace/XS3/XS/ws/code/prereq.jemalloc/share/man</font>
<br>
<br><font size=2 face="sans-serif">srcroot        
   : </font>
<br><font size=2 face="sans-serif">abs_srcroot        :
/root/kWebSphere/workspace/XS3/XS/ws/code/prereq.jemalloc/src/jemalloc-3.3.1/</font>
<br><font size=2 face="sans-serif">objroot        
   : </font>
<br><font size=2 face="sans-serif">abs_objroot        :
/root/kWebSphere/workspace/XS3/XS/ws/code/prereq.jemalloc/src/jemalloc-3.3.1/</font>
<br>
<br><font size=2 face="sans-serif">JEMALLOC_PREFIX    : je</font>
<br><font size=2 face="sans-serif">JEMALLOC_PRIVATE_NAMESPACE</font>
<br><font size=2 face="sans-serif">           
       : </font>
<br><font size=2 face="sans-serif">install_suffix     : </font>
<br><font size=2 face="sans-serif">autogen        
   : 0</font>
<br><font size=2 face="sans-serif">experimental       :
1</font>
<br><font size=2 face="sans-serif">cc-silence        
: 0</font>
<br><font size=2 face="sans-serif">debug          
   : 0</font>
<br><font size=2 face="sans-serif">stats          
   : 1</font>
<br><font size=2 face="sans-serif">prof          
    : 0</font>
<br><font size=2 face="sans-serif">prof-libunwind     : 0</font>
<br><font size=2 face="sans-serif">prof-libgcc        :
0</font>
<br><font size=2 face="sans-serif">prof-gcc        
  : 0</font>
<br><font size=2 face="sans-serif">tcache          
  : 0</font>
<br><font size=2 face="sans-serif">fill          
    : 1</font>
<br><font size=2 face="sans-serif">utrace          
  : 0</font>
<br><font size=2 face="sans-serif">valgrind        
  : 0</font>
<br><font size=2 face="sans-serif">xmalloc        
   : 0</font>
<br><font size=2 face="sans-serif">mremap          
  : 0</font>
<br><font size=2 face="sans-serif">munmap          
  : 1</font>
<br><font size=2 face="sans-serif">dss          
     : 0</font>
<br><font size=2 face="sans-serif">lazy_lock        
 : 0</font>
<br><font size=2 face="sans-serif">tls          
     : 1</font>
<br><font size=2 face="sans-serif">===============================================================================</font>
<br>
<br><font size=2 face="sans-serif">3) jemalloc runtime:</font>
<br>
<br><font size=2 face="sans-serif">Version: 3.3.1-0-g9ef9d9e8c271cdf14f664b871a8f98c827714784</font>
<br><font size=2 face="sans-serif">Assertions disabled</font>
<br><font size=2 face="sans-serif">Run-time option settings:</font>
<br><font size=2 face="sans-serif">  opt.abort: false</font>
<br><font size=2 face="sans-serif">  opt.lg_chunk: 21</font>
<br><font size=2 face="sans-serif">  opt.dss: "secondary"</font>
<br><font size=2 face="sans-serif">  opt.narenas: 96</font>
<br><font size=2 face="sans-serif">  opt.lg_dirty_mult: 6</font>
<br><font size=2 face="sans-serif">  opt.stats_print: false</font>
<br><font size=2 face="sans-serif">  opt.junk: false</font>
<br><font size=2 face="sans-serif">  opt.quarantine: 0</font>
<br><font size=2 face="sans-serif">  opt.redzone: false</font>
<br><font size=2 face="sans-serif">  opt.zero: false</font>
<br><font size=2 face="sans-serif">CPUs: 24</font>
<br><font size=2 face="sans-serif">Arenas: 96</font>
<br><font size=2 face="sans-serif">Pointer size: 8</font>
<br><font size=2 face="sans-serif">Quantum size: 16</font>
<br><font size=2 face="sans-serif">Page size: 4096</font>
<br><font size=2 face="sans-serif">Min active:dirty page ratio per arena:
64:1</font>
<br><font size=2 face="sans-serif">Chunk size: 2097152 (2^21)</font>
<br>
<br><font size=2 face="sans-serif">4) strace summary</font>
<br>
<br>
<br>
<br><font size=2 face="sans-serif">        bye,</font>
<br><font size=2 face="sans-serif">         
      kMartin</font>
<br><font size=2 face="sans-serif">.</font>
<br>
<br>
<br>
<br>
<table width=100% style="border-collapse:collapse;">
<tr valign=top height=8>
<td width=96 style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif">Jason
Evans <jasone@canonware.com></font>
<tr valign=top height=8>
<td width=96 style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif">Kurtis
Martin/Raleigh/IBM@IBMUS, </font>
<tr height=8>
<td width=96 valign=top style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 color=#5f5f5f face="sans-serif">Cc:</font>
<td style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif">jemalloc-discuss@canonware.com</font>
<tr valign=top height=8>
<td width=96 style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif">06/03/2013
07:23 PM</font>
<tr valign=top height=8>
<td width=96 style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif">Re:
High amount of private clean data in smaps</font></table>
<br>
<hr noshade>
<br>
<br>
<br><font size=3>On May 30, 2013, at 4:06 PM, Kurtis Martin wrote:</font>
<br><font size=1 face="Segoe UI">1) Why does jemalloc have smaps with such
large Private_Clean size?  I'm actually surprised jemalloc has such
large smaps in general.  I would expect a bunch of smaller smaps that
match the configured chunk size.</font><font size=3> </font>
<br>
<br><font size=3>I've been trying to figure this out for quite a while
now, and I have yet to come up a way to transition pages that were mapped
as MAP_PRIVATE|MAP_ANON to the Private_Clean state.  My experiments
included fork(2) abuse, mmap'ed files, shared anonymous memory, etc., and
I'm currently out of ideas.  If you're able to observe a process as
its Private_Clean page count is increasing, can you capture an strace log
to see what system calls are occurring?  Also, can you tell me the
Linux kernel version you're using, jemalloc configuration (e.g. whether
munmap is disabled), and jemalloc run-time options specified?</font>
<br>
<br><font size=3>Regarding large smaps, all the Unix operating systems
I've dealt with coalesce mappings that have identical attributes.  If
jemalloc maps two chunks that happen to be adjacent to each other, the
kernel tracks them as a single mapping.  jemalloc goes to some effort
to make coalescing possible, because Linux unfortunately does linear map
scans that severely degrade performance if the number of map entries isn't
kept low.</font>
<br>
<br><font size=3>Thanks,</font>
<br><font size=3>Jason</font>
<br>
<br>
<br>