You can limit the document cache using "
Raven/MemoryCacheLimitMegabytes" however there are other things that take memory, such as Esent and pre-fetching. See
http://ravendb.net/docs/server/administration/configuration for more info, but it's probably best to let Raven do it's think and self-adjust where needed.
The ESENT out of memory, version store issue is related to this value "Raven/Esent/MaxVerPages"
But as Chris says, RavenDB generally takes as much memory as is available, on the assumption that it's running as a server. It does however cut-back if it is detect low-memory situations.