Results 1 to 9 of 9

Thread: Virtual memory

  1. #1
    5 Star Lounger
    Join Date
    Dec 2009
    Location
    London
    Posts
    703
    Thanks
    256
    Thanked 4 Times in 4 Posts

    Virtual memory

    Hi,
    Would some kind soul explain, in terms that even I can understand, exactly what is virtual memory and what does it do?

    Wikipedia’s article is far above my level of comprehension, and Google produces lots of companies offering applications to make my PC more efficient, in some cases even for free. However, I have never heard of any of them before, and wonder what else they might download at the same time.

    Why do I ask? Well, my PC has been malfunctioning for a couple of weeks. It won’t close without me switching off manually, and doing so 2 or 3 times a day can’t be good for it. Perhaps I should qualify this by mentioning that one evening last week I left it closing down and did Sudoku – it must have been a difficult one, because when I had finished the PC had finally closed. The next day I decided to see how long it takes, but gave up after 32 minutes with it still trying to do so.

    Worse than this is the fact that applications keep seizing up when I have several open, and the only way to get out is again to manually close and restart.

    Last Saturday a pop up opened, saying that the virtual memory was very low, and Windows would create more. How does the system create memory out of nothing?

    Anyway, there were no problems for about 48 hours, then the problem returned when using Sharescope. This is a crucial tool for my trading and investing, but is a massive programme and always takes several minutes to open or close, due to the fact it lists all UK shares, unit trusts, investment trusts, warrants,bonds etc. And it has recently become even bigger now that it includes all US equities. It has just occurred to me that the problems began about the same time, but I can not do without it.

    So how do I sort out virtual memory on a permanent basis, or would adding more memory do the trick? Do memory and virtual memory perform the same tasks?

    I would be most grateful for guidance in this matter.

  2. #2
    Plutonium Lounger Medico's Avatar
    Join Date
    Dec 2009
    Location
    USA
    Posts
    12,631
    Thanks
    161
    Thanked 936 Times in 856 Posts
    Basically virtual memory is accessed when your PC runs out of RAM memory. All apps are loaded into RAM memory when you start them. If your amount of RAM memory is not enough (remember your windows OS itself also is loaded into RAM) then the OS sets aside an amount of your HD as Virtual Memory. Although this generally works fine, Virtual Memory is much slower than RAM. Adding more RAM is an excellent way to help with this slow down. Not having as many apps open at the same time will also help. You will have to check the specs of your PC to see just how much and what kind of RAM you have and can add. An app such as SIW can give you a plethora of info on your PC.
    BACKUP...BACKUP...BACKUP
    Have a Great Day! Ted


    Sony Vaio Laptop, 2.53 GHz Duo Core Intel CPU, 8 GB RAM, 320 GB HD
    Win 8 Pro (64 Bit), IE 10 (64 Bit)


    Complete PC Specs: By Speccy

  3. The Following User Says Thank You to Medico For This Useful Post:

    georgelee (2011-07-21)

  4. #3
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    Virtual Memory is a capability offered by modern operating systems that allow applications to use memory even beyond the available physical RAM amount. So, an application can ask more memory than it is available and the operating system will deal with moving contents from physical RAM to disk, as needed, to accomodate those requests. The amount of virtual memory is bigger than the physically available RAM and the operating system will take care of moving stuff from RAM to disk, in a manner that tries to suit the needs of the different applicatons running at a given moment, making the different applications totally ignorant of where their allocated memory contents are at any given moment. Of course, disks are much slower than physical RAM, so the moving of contents between memory and disk, called memory swapping, is a costly and slow operation.

    Swapped memory contents reside on a specific file, so when windows tells you it was increasing virtual memory, it actually was resizing this file.

    You probably need to investigate the reasons for the long shutdown times. What OS are you using?
    Last edited by ruirib; 2011-07-21 at 16:43. Reason: typos

  5. The Following User Says Thank You to ruirib For This Useful Post:

    georgelee (2011-07-21)

  6. #4
    5 Star Lounger
    Join Date
    Dec 2009
    Location
    London
    Posts
    703
    Thanks
    256
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by Ted Myers View Post
    An app such as SIW can give you a plethora of info on your PC.
    It sure does, at least 90% is meaningless to me. However, I was amused by the list of 6 printers, when there is only one installed. No idea how they can call Omnipage Pro and Nitro PDF reader printers.

    Thanks for your advice Ted, it seems that getting more RAM is a better course than depending on the vagaries of virtual memory.

    George

  7. #5
    5 Star Lounger
    Join Date
    Dec 2009
    Location
    London
    Posts
    703
    Thanks
    256
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by ruirib View Post
    You probably need to investigate the reasons for the long shutdown ties. What OS are you using?
    Thanks for the comprehensive explanation. Now that the mystery of virtual memory has been clarified I can look into the lesser problem of the PC not closing at the end of the day - I can remember see articles on it WS, probably by Fred Langa. Operating system is XP Home Edition, SP3.

  8. #6
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    Shame that you are running XP. Starting with Vista, Microsoft added features to determine applications affecting system performance during boot and shutdown, so I was expecting you could be running one of those. I can't really suggest much about XP other than a trial and error approach to determine which app may be causing that abnormal behavior.

  9. #7
    Super Moderator satrow's Avatar
    Join Date
    Dec 2009
    Location
    Cardiff, UK
    Posts
    4,492
    Thanks
    284
    Thanked 577 Times in 480 Posts
    I'd set the virtual memory to use a minimum and maximum of 4092MB.

    UPHClean may fix your shutdown problem, if not, BootVis will allow tracing of shutdown events.

  10. #8
    5 Star Lounger
    Join Date
    Jan 2010
    Location
    Los Angeles, CA
    Posts
    828
    Thanks
    4
    Thanked 38 Times in 34 Posts
    The basic idea behind why virtual memory works is the good old 80/20 rule. Applied to applications, most need only 20% of them memory they actually ask for. The other 80% is stuff they they might need at some point, but not necessarily right now. For example, when you are editing a Word document, how much of it are you accessing at any point in time? Perhaps a page or two. The rest you don't need at this very moment. (Note that this is just an example and not exactly accurate, but it should give you some idea of what is going on and why.)

    Virtual memory lets you assign some disk space as pseudo memory. Thus instead of having, for example, 4GB memory (which is how much RAM you have), you can have what appears to be 8GB of memory (4GB RAM + 4GB disk). The operating system handles the swapping of data between RAM and virtual memory. Essentially what it does is map the memory that the application thinks it has between the RAM and the virtual memory. If the application needs something that is in virtual memory (for example, you go to some other pages in your Word document and those pages are in virtual memory), the operating system will quietly and quickly move data around such that the data that was in virtual memory (e.g. the pages you now want to edit) are in RAM. Eventually, the operating system will detect that you are no longer interested in the Word pages that you were looking at and will swap those out to virtual memory, thus freeing up the RAM for other tasks.

    Windows is a little more aggressive that Linux when it comes to virtual memory. Windows tends to move data to virtual memory when it detects the application is not using it, even if you have lots of available RAM. In Windows 7 this is a good thing - Windows 7 will use available RAM to memory-map files, thus speeding up overall operation. Linux, on the other hand, will wait until RAM usage hits a certain threshold before swapping data out to virtual memory. This is one of the reasons Linux appears to (or actually does) run faster than Windows on the same hardware (the other reason is that Linux is usually not encumbered with anti-virus software, and that makes a huge difference on performance).

    But the end result is the same - you can run more applications than you have available RAM. Of course, if you have 8GB or more of RAM, you could set the virtual memory size to 0 (I ran like that for a while). As long as your applications don't need a total of more memory that that, you are fine.

  11. #9
    Bronze Lounger DrWho's Avatar
    Join Date
    Dec 2009
    Location
    Central Florida
    Posts
    1,501
    Thanks
    30
    Thanked 205 Times in 163 Posts

    Cool

    Nowhere have you stated exactly how much RAM memory (physical memory Chips attached to your motherboard) that you actually have. Not having sufficient RAM for your Operating System (OS) and your programs, can really slow down your PC.
    For Windows XP, 32 bit, you should have at least 2 gigabytes of physical RAM. Three gig's would be better, but that's all any 32 bit OS can actually read. Any more than 3 gig's is just a waste.

    I regularly order extra RAM for my customers. Then I'll usually go back a few days later and install it for them.
    On their PC's, I go to www.crucial.com and take their ram test. It comes back with a report on just what they have already and how much more could be installed, in what configurations and also lists the cost of the needed ram sticks.
    Then if the person wishes, they can order the new ram right there from Crucial's web site, using their credit card of debit card. It will be delivered in three to five days by First Class Mail.
    Even if they decide to NOT get more ram, it's nice to know just where they stand.

    For most PC's, windows will set aside 1.5x the size of physical ram as "Virtual Memory" in a file called the "Pagefile.sys".
    You can see that file in your root directory, if you have Windows Explorer set to "Show Hidden Files".

    In most cases, if you're getting error messages that you're running low on Virtual Memory, it means that you're just running too many programs and services on your PC at one time. In other words, you're not operating your PC properly, for the hardware you have.

    I deal with this problem every week. It's what I do as a computer technician. The fix is not usually just one thing, but a whole list of things that need to be changed. Often, when the hardware and software cannot be changed, then it's the operator that must change.

    Windows XP is a pretty good OS. It's been upgraded and fixed by MS over the past 10+ years, till it's about as stabil as you can get. I run XP-Pro-SP3 myself and I never have any problems with it. It boots in about 20 sec's and shuts down in 5 to 8 sec's. I never get BSOD's or freezes.

    But, I do run a cleanup batch file on boot that takes out all the garbage files left over from the day before, and I shutdown using a custom Quick Shutdown shortcut on my desktop, that forces reluctant programs to close.

    Just got a service call, so gotta run. Catch y'all later,
    Cheers Mates!
    The Doctor
    Experience is truly the best teacher.

    Backup! Backup! Backup! GHOST Rocks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •