Hi Cedric!
A couple of points:
1) It's normal and expected for MongoDB RAM use to grow to the amount of RAM installed on the machine. You can manage this somewhat by changing the amount of RAM allocated to a virtual machine.
2) DO NOT try to limit MongoDB RAM use by setting 'ulimit'. Doing so will cause MongoDB to crash, and can cause potential data loss.
3) If you're running MongoDB in production, you should not have any other RAM-hungry process running on that machine.
4) In general, you should take one of two strategies when limiting RAM usage for MongoDB
- Limit RAM usage by sizing the amount of RAM allocated to a VM
- If you're not using a VM, use 'cgroups' to limit the amount of RAM available to MongoDB. For a user-friendly interface to 'cgroup', I'd recommend Docker
Note that it's probably not advisable to use Docker on top of a VM in production.
-William