I am looping over a series of CSV files row by row. For each row I create a BSONObjBuilder object and then add builder.obj() to a std::vector ... every 10k rows I insert the vector to the database and then clear the vector
mdb.insert(collection, myvector);
myvector.clear()
There are millions of rows in each CSV files. I have noticed that the mongod process is taking up more and more RAM.... until eventually the memory usage is at 100%
PID USER PR NT VIRT RES SHR S %CPU %MEM
4450 mongod 15 0 73.2g 34g 33g S 45.7 97.0 3848:30 mongod
What is going on here? It seems to me like there is a memory leak? There is definitely no memory leak in my code.