Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2004-09-07
7
Medium Priority
?
4,460 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
6 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 200 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
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 walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
Suggested Courses

581 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