Solved

Disk cache vs virtual memory in Windows...what's the difference?

Posted on 2004-09-07
7
4,448 Views
Last Modified: 2013-11-15
Hoping everyone can help set me straight on this subject, because I have often thought these two were the same thing.

This subject was brought up because we're using an app that requires a lot of memory (both physical and virtual).
One of my team members asked if we should re-configure the app to not write so much data out to memory, and let Windows Disk Caching handle the load.

Now, to my knowledge, disk caching occurs when an action is performed repeatedly in windows, and Windows caches the required info for that action to speed things up. Now, isn't that "cache" in virtual memory anyway?

Would really appreciate an assist here, I learned most of the principles of computers off of *nix boxes, and sometimes Windows throws me a curve, so I want to make sure I understand what's going on here.

Many thanks!
0
Comment
Question by:Inward_Spiral
  • 3
  • 2
7 Comments
 
LVL 44

Expert Comment

by:CrazyOne
ID: 11996306
>>>Now, isn't that "cache" in virtual memory anyway?

Umm well yes and no and maybe. Of cousrse most modern Hard disks have a "CACHE" which is RAM on the hard disk. Now cache can go into yeah virtual memory or if there is enough RAM on the system then perhaps it will all go to RAM and perhaps not.

On my machine (XP Pro) I have elimanated the Virtual Memory(Pagefile) so everything goes to RAM for me.
0
 
LVL 44

Assisted Solution

by:CrazyOne
CrazyOne earned 50 total points
ID: 11996350
Oh I did not mean to indicate that because I don't use a PageFile (VirtualRam) that the Hard Disk doesn't CACHE. I know confusing isn't it. :) Well for all intense and purposes if the app is heavily dependent on the hard disk(s) then the HDD cache will come highly into play. However if the app is launched and then app will fit into RAM and if enough room in RAM is not available it in a sense the excess will be off load to the PageFile and some of the code in that app may also be hard coded to do the same.
0
 

Author Comment

by:Inward_Spiral
ID: 11996465
So, if there isn't a pagefile, and the app won't fit into RAM, then windows can still employ an HDD cache?
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 44

Expert Comment

by:CrazyOne
ID: 11996572
No not quite. The disk Cache and RAM are independent items. I suspect what you were told is off load things like data to the Write Behind Cache. Which if I am not mistakens means write to disk when system is somewhat Idle especailly the disk or otherwise write to disk when OS is shutting down.
0
 
LVL 16

Accepted Solution

by:
JammyPak earned 50 total points
ID: 11997407
I think you've got things mixed around, Inward Spiral.

Virtual memory = pagefile.sys, or, harddrive space that's used instead of RAM.
System Cache = free memory that is allocated to storing items that the O/S thinks will likely be used again, or, RAM that's used instead of HardDrive.
(I mean disk cacheing done by Windows, not hardware-level stuff....)

One is harddisk and one is RAM...there's no 'one or the other', they're completely separate things.

Virtual memory is always used when a pagefile is present, but it's more heavily used when the system does not have sufficient physical memory to store everything it wants to store. System Cache will be used whenever there's spare RAM that isn't being used. If most of your RAM is being used, then there's not as much left over to cache items with.

My recommendation for your app is to load up on physical RAM as much as possible. This way, you'll end up using less pagefile (so less paging, and way better performance), plus you'll have more spare RAM that Windows will allocate to system cache (better performance again).

Your system cache is definitely not in virtual memory - it's always in RAM by definition...the O/S would never write out to disk something that it was temporarily cacheing in RAM 'just in case'.

The 'Write-Behind-Cache' that CazyOne mentioned is enabled by default, so you're probably already taking advantage of it. This is when a call to save data to the disk is actually delayed - the data is stored in memory (Physical RAM only!) until the system is idle, and then the data is written to the disk. It can boost performance, but there's also some danger there if the system crashes before the actual disk write takes place. You can disable it by going into Device Manager, and in the properties of your HardDrives, on the 'Disk Properties' tab, there's a 'Write Cache Enabled' check box (but unless you've unchecked it previously, it will already be checked).

0
 

Author Comment

by:Inward_Spiral
ID: 12870829
My fault for not awarding points after JammyPak and CrazyOne helped me out.
Both of you were a big help, I can't believe I didn't close out this post and credit you two!
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Learn about cloud computing and its benefits for small business owners.
Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now