I'm using mongodb for saving log data.
When I have to find something from log data, which could be over than 1,000,000 documents, all the process work properly but the issue is that memory usage doesn't get down even though the process has been finished.
When I enter 'top' command on the server that runs mongod process, it shows resource information like below screenshot.
Memory usage for the mongod process was less than 10%, but after using a lot of find() queries, it increased to 38.9% and never decreasing. What causes this kind of issue and what do I do to decrease the memory usage of mongod process except restarting?
I didn't know that this question is not appropriate for stackoverflow site, but when I asked the same question in stackoverflow someone replied me like this. "Of course it doesn't, it's a database. They are meant to consume memory and hold on to it"
But what I did with my code was just using .find() query, nothing was added to database. Does it mean that only using find() query could have caused increasing of memory usage and not releasing it? I don't understand help me please