What is "secd" process? I wonder what secd process does under OSX Yosemite. I am pretty sure I have seen this process running in earlier MacOS versions, but I don't remember it gobbling up all the available memory so boldly...

I have three computers running Yosemite, each with a different config. All three have been up for a duration of three days to one week. Here is a run down of what secd has achieved:


On MacBookAir 2011 with 4GB of memory, 700MB allocated to secd
On iMac 2008 with 6GB of memory, 2GB allocated to secd 
On iMac 2011 with 12GB of memory, 4GB allocated to secd


On all three computers secd is the largest process in memory (larger than kernel task) and I suspect it plays a role in the slowdown I have recently experienced with the arrival of Yosemite. I know for sure that the process expands in memory to inordinate sizes and frees up memory when I need it somewhere else. The only issue is that it is not as quick in freeing up memory and most of the time performance suffers before the process realizes it has to retreat. 

My search around the web didn't come to a solid conclusion as for what the process is, and why it should be so huge. I guess I am not the only one experiencing this. Any tip is appreciated.  

As suggested below secd has to do with Apple Keychain. Here are the files and ports that the process keeps open when active (on MacBookAir):

/
/usr/libexec/secd
/Users/.../Library/Keychains/7285EFCF-9AF6-53DD-BE44-DA1F59F96620/keychain-2.db-shm
/usr/share/icu/icudt53l.dat
/usr/lib/dyld
/private/var/run/diagnosticd/dyld_shared_cache_x86_64
/dev/null
/dev/null
/dev/null
count=2, state=0x2
/Users/.../Library/Keychains/7285EFCF-9AF6-53DD-BE44-DA1F59F96620/keychain-2.db
/Users/.../Library/Keychains/7285EFCF-9AF6-53DD-BE44-DA1F59F96620/keychain-2.db-wal
/Users/.../Library/Keychains/7285EFCF-9AF6-53DD-BE44-DA1F59F96620/keychain-2.db-shm
/Users/.../Library/Keychains/7285EFCF-9AF6-53DD-BE44-DA1F59F96620/keychain-2.db
/Users/.../Library/Keychains/7285EFCF-9AF6-53DD-BE44-DA1F59F96620/keychain-2.db-wal
/dev/random
/dev/random
/private/var/folders/z_/806bzc396cxgp4s0q17tpfwc0000gn/T/etilqs_y5BDgkbGkBV9ybF
/private/var/folders/z_/806bzc396cxgp4s0q17tpfwc0000gn/T/etilqs_Aw6Q7JhPlil3QNX
/Users/.../Library/Keychains/7285EFCF-9AF6-53DD-BE44-DA1F59F96620/keychain-2.db
/Users/.../Library/Keychains/7285EFCF-9AF6-53DD-BE44-DA1F59F96620/keychain-2.db-wal


What is not clear is what the process does to all the memory it occupies, and why it inflates so much.
If it's not apparent, this is just a guess. But hopefully it gives you some leads.

First, here's what you can figure out just from the program name. If you run the command /bin/ls /usr/libexec | sort -f | egrep '.*d$' (this print all files in /usr/libexec ending in d), you'll find ftpd, hidd, networkd, systemstatsd, and a lot of programs ending in d. The "d" stands for "daemon", which basically means a helper process that always runs in the background. The sec very likely stands for "security". So secd is the "security daemon". Which makes sense because you said it looks like it works with keychain stuff.

What's the point of daemons? Some daemons stay running to either do some ongoing task. hidd ("human interface device daemon"), for example, is the process responsible for handling mouse/keyboard/trackpad input. Some other daemons do some common tasks that many other programs need. Apps can simply tell the daemon to do something instead of having code to do it themselves. So secd probably does something like this, but related to the keychain.

But what exactly? It looks like it doesn't actually handle normal use of the keychain, since I was still able to use the keychain after I disabled the secd LaunchAgent.

Inspecting the LaunchAgent gives us a clue:


It looks like secd is responsible for syncing the keychain with iCloud?

So what should you do? Try one or more of these:


If you don't need iCloud keychain syncing, turn it off in iCloud preferences.
Use launchctl to disable secd if it doesn't seem to adversely affect anything.
If you need iCloud keychain syncing, see if you have a ton of keychain items, and remove the ones you don't need.
Perhaps rebuild your keychain (make a new keychain, move items you need into it, and move it over the older one), in case there are unnecessary artifacts left over in the old keychain.