Reported with this pull request:
https://github.com/mongodb/mongo-python-driver/pull/316
Inflating RawBSONDocument causes a memory leak when the C extensions are installed. The problem is caused by using the O format specifier instead N for Py_BuildValue in _cbson_element_to_dict. Iterating a cursor from a collection that uses RawBSONDocument for document class leaks two references for every cursor batch.