Solved

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

Posted on 2004-09-07
7
4,452 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to update backup definition in  TSM for an Oracle server. 6 76
Connecting two servers 30 91
User profile Size Report 3 91
Open Encryption Software Advice needed 4 73
Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
Microsoft will be releasing the Windows 10 Creators Update in just a matter of weeks. Are you prepared? Follow these steps to ensure everything goes smoothly and you don't lose valuable data on your PC.
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
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…

733 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