Does Varnish require much RAM?
Other than virtual memory, How about RAM usage for Varnish?
Is it much RAM needed?
You can run Varnish in a few different modes. One uses the disk as the cache repository and in this mode, you can safely restart Varnish without losing your cache. This also means you can support a very large cache and let the OS's IO cache keep the most requested content in the server's memory. This mode is configured with the flag -s file,/var/lib/varnish/varnish_storage.bin,1G
The other mode is memory-only - Varnish keeps all cached data only in memory, never writing to disk. This can deliver extremely fast response times, but the cache size is limited to how much memory your server has. Also, if you restart Varnish you lose the cache and suddenly requests will start flooding your backend. Note, however, that Varnish is extremely stable and we only ever restart Varnish when an update is released (every 6 months or so). This mode is configured like -s malloc,3200M
So to answer your question, Varnish performs much better with more RAM. We have a Amazon EC2 instance with 3.5GB RAM and no swap and give Varnish 3GB of RAM for caching. Currently we have almost the entire backend site in cache, including images and PDF files etc. I can definitely recommend this setup.
Varnish actually supports multiple storage backends. You can cache something to RAM, whereas something to disk:
-s default=malloc,256m \
-s static=file,/var/lib/varnish/varnish_storage.bin,1G"
This is most useful to conditionally store static files cache (.css, .js files) to disk, and storing full page cache into RAM. You will need to adjust your .vcl file appropriately to cache conditionally into each storage backend: https://www.getpagespeed.com/server-setup/varnish-static-files-cache
This will allow you to keep memory footprint at minimum, whereas still using part of RAM for cache.