VPS restarts, MongoDB does not

I’m not too tech savvy when it comes to the server configuration & administration. I’ve installed MongoDB using the default one-click installation and here’s what’s happening:

  1. MongoDB slowly grabs more and more memory, maxing out whatever amount I’d specify
  2. The VPS is restarted
  3. MongoDB does not start automatically after the restart

Currently I need to log in to the server, sudo bash and then run “service mongodb start” but it does not happen automatically.

I can’t figure it out by myself, so please help me out here to either restrict the memory available to MongoDB (so it doesn’t grab more than XXX MBs) or to start it up automatically after the restart (what to put/change in which file).

Thanks in advance.