Isn't the point of caching things in main memory to avoid the expensive disk i/o?
If you're caching things in the swap space of a hard drive, how does that avoid disk i/o?
Isn't the point of caching things in main memory to avoid the expensive disk i/o?
If you're caching things in the swap space of a hard drive, how does that avoid disk i/o?
Generally the memory used by the cache wouldn't get swapped out. It would be marked as in-use.
edit - Yes virtual memory is memory blocks copied to disk because the RAM is full. In order to use it you have to copy it back into memory (which is slow).
Cache is keeping copies of recently used files in memory because this is quicker than going back to disk for them. There is a conflict here - the more RAM you use for cache, the more other memory you have to swap out to disk.
This isn't necessarily bad, there are lots of things running on your computer that only run occaisonally and so pushing them out to disk to make space for cached copies of your photos might make sense.