Mongos seems to leak on every findOne query.
How to reproduce? I've configured sharding using example script: http://github.com/mongodb/mongo-snippets/blob/master/sharding/first.js
I ran this script once and then tried to benchmark query time using the following code in the client:
for (i = 0; i < 400; i ++) { for (num = 0; num < 100; num ++) { db.data.findOne(
{"num" : num}) }; } 1;
When running this code I noticed mongos quickly grows in size in memory. Restarting client doesn't seem to release any memory resources in mongos. I could reproduce it first with mongodb 1.2.0, then I tried 1.2.2, 1.3.1 and finally with the latest git and all versions showed the problem. I'm sorry, I'm not sure how mongodb version number maps to version number of mongos so I've set only latest release and unreleased version numbers in jira's selection box but I guess it probably affects all versions.
P.S. I've tried to run mongos under valgrind and it confirms the problem. See the attached valgrind log.