Liam,
Thanks for creating and releasing smtptrapd.
When running smtptrapd on my linux system I was surprised to see
smtptrapd consuming 80MB of RAM. My system doesn't have an awful lot
of RAM so this was a concern to me. I tracked down the memory usage
to the use of threads. Most specifically the default settings for
creating a thread on Linux creates a very large (megabytes) stack for
each thread. I made the following changes to the code:
1) for Linux create an attribute to pass to pthread_create that sets
the stack size to a reasonable value.
2) added the missing "f:" from the getopt string for proper pidfile
processing.
3) enhanced the makefile a bit
4) included the script I use to start smtptrapd at startup.
The thread changed dropped memory consumption from more than 80MB to
less than 2MB and I could probably squeeze more out of it by further
tweaking the stack size.
I'm considering making a single threaded version of smtptrapd that
uses select or poll instead of threads. If I do I'll pass it along to
you.
Thanks,
Greg
patch reducing memory usage on Linux