Hi all,

I've been trying to track down why my naviserver processes have such a 
large memory footprint compared to similarly configured aolserver 
processes.  One culprit I already found is the pre-allocation of 
per-conn compression streams (the fixes to this have already been 
mentioned, tho not yet committed).

The other culprit is strange.  It appears that naviserver is completely 
ignoring the stacksize parameter, and starting all threads with the 
default size, which on linux is the maximum stack size at process start 
time, 8Mb by default.    This isn't a case of the wrong parameter being 
set, it appears to be a behavior of the nsthread library.  nsthreadtest 
shows the same behavior, even after it calls

  Ns_ThreadStackSize(81920);

I've added a debug printf to pthread.c to double-check what is being 
passed as the stacksize parameter, and it's the expected value in all 
cases, it's just not used for some reason.  I've been using strace to 
peek at what's going on, and nsthreadtest in naviserver looks like

mmap2(NULL, 8392704, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0xb4bfa000
mprotect(0xb4bfa000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb53fa494, ...

while in aolserver it's

mmap2(NULL, 90112, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0xb748b000
mprotect(0xb748b000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb74a0494, ...


As you can see it's an ~8M vs 90k (81920 + guard pages) allocation.

Does anyone else on linux see the same behavior, or should I be looking 
at local differences?

Second, the naviserver and aolserver nsthread libraries aren't 
identical, but they aren't very different.  Any ideas what would be 
causing this behavior?

-J

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to