Re: crm memory usage

[email protected] (Bill Yerazunis) Tue, 7 Jul 2009 08:58:24 -0400 (EDT)
Newsgroups gmane.mail.spam.crm114
Message-ID <20090707125824.0AFCD3DE301@starbuck>
   From: "[email protected]" <[email protected]>

   Hi,

   I'm still battling memory usage on my admittedly cheap & cheesy VPS
   environment.

   crm keeps failing with 'can't fork your minion' messages. (On syscalls.) I
   looked at the code and found that syscall uses fork(), which makes a
   complete copy of the parent process. I'm not an experienced c-programmer
   but I assume the memory usage doubles there and then.

It shouldn't, under Linux at least.  "Fork" modifies the page table so
that the pages aren't copied immediately- they're shared and only copied
when one of the copies is written to.

So, the actual jump at "fork" is only the per-process stuff.  Of course,
as soon as anything happens (like modifying any of the big buffers)
then a whole lot of pages get copied.

   I believe the crm process uses some 50+ mb of memory, so fork would lead
   to 100+ megabytes usage. This is what I did:

   vmstat
   crm mailreaver.crm
   Ctrl-Z
   vmstat

   This vmstat before and after gave me the 50+ number. This seems like an
   awful lot.

   I tried to use much smaller .css files (cssutil -S 250) but this didn't
   change anything.

   Is there anything to be done about this. I've read that crm uses memory
   mapping instead of file IO to get performance. I'll happily trade
   performance for less memory usage.

Sorry, but right now there is no option to use file I/O instead of
memory-mapping.  The two are very very different ways of doing the
same task.  

   Thanks for reading this! :-)

No problem.  Too bad I don't have good answers for you.

If it's really the case that you can't afford a fork, then don't
do it.  Yes, it's true that mailreaver has some nice hooks
and wriggles, but if you can trick Mutt into feeding back
a pretty-much-unaltered copy of the original text (with no
headers added or suppressed) then just using a one-line
training script will do about the same job. 

   - Bill Yerazunis

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have 
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/blackberry