Virtual memory, page file use

KeypoX

Diamond Member
Aug 31, 2003
3,655
0
71
It seems very common to read about memory usage and people tend to think that virtual memory is only used when you run out of RAM.

I thought this too, until i noticed in XP more virtual memory was being used than actually memory even when RAM was free. In vista I cannot find the total used virtual memory but do see that on task manager it shows how much paged memory is being used by the kernel.

Can anyone tell me why virtual memory is being used when i have 3GB of free RAM? Im hoping that it somehow knows to only used page memory when doing tasks that dont require speed?
 

Aberforth

Golden Member
Oct 12, 2006
1,707
1
0
Virtual memory is needed even if you have 8 GB ram, if you load all of the windows files from the start up it can easily fill up your entire RAM and will have no room for other programs and therefore reduces the overall performance. Page File usage is also dependent on how the application is designed, some programs are designed to use page file, like games for instance- map large files into memory which are constantly dumped to paged file. When a program requires large contiguous free space to process data the page file will come in handy. So the whole purpose of page file is to store inactive data and move them to memory only when accessed. This method also increases data reliability when handling critical operations.

For more information read this: http://en.wikipedia.org/wiki/Virtual_Memory
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Can anyone tell me why virtual memory is being used when i have 3GB of free RAM? Im hoping that it somehow knows to only used page memory when doing tasks that dont require speed?

Because virtual memory isn't pagefile usage. Virtual memory is just a method for presenting physical memory via fake, i.e. virtual, addresses. The pagefile and virtual memory aren't related at all except for the fact that virtual memory makes using the pagefile as a backing store really simple.
 

pallejr

Senior member
Apr 8, 2007
216
0
0
You don't actually code your application to use the paging file. It is internal to Windows and invisble to applications. Memory mapped files are something else. Fragmentation in the physical address space doesn't matter either, it will still be contigous in the application's address space.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
You don't actually code your application to use the paging file.

As I understand it there are a few APIs that allocate pagefile backed buffers and if there is no pagefile they'll fail. But I would guess that their use is pretty specialized and rare.
 

pallejr

Senior member
Apr 8, 2007
216
0
0
I'm not aware of such. All memory types can be backed physical memory alone. So as long as you don't run out it, it will not fail.
 

inhotep

Senior member
Oct 14, 2004
557
0
0
Ok, here is what I have to say about the topic. I have experimented with it, not just reading it. Depending on your usage, 3GB ram is not enough for to turn pagefile to 0MB, especially for VISTA. My advice to you, play around with the size of your virtual memory, including to 0MB, and look at your performance monitor.
You will get an idea of how much RAM you need from there. If you have enough ram that meet your needs, you don't have to use virtual memory.
For me, after I have upgraded to 6GB ram, I can safely turn virtual memory to 0 and NO PROBLEMS. I cannot do this before the upgrade with 2GB.
Windows would use more ram with virtual memory off and so will applications. I do monitor ram usage and so far so good. Yes computer will run faster if you have enough physical RAM not to use swap file. Imaging swapping between RAM and much slower virtual RAM on your hard disk.

It really depends what you use your computer for. If you use your computer to browse the web, you don't need virtual memory with 3GB. But if you do more than surfing the internet with 3GB, you would need virtual memory in case the memory required is more than 3GB of your physical ram.

People who give advice on topic from what they read without actually trying them is not that dependable. Plus people interpret words from what they read differently.
 

KeypoX

Diamond Member
Aug 31, 2003
3,655
0
71
Originally posted by: inhotep
Ok, here is what I have to say about the topic. I have experimented with it, not just reading it. Depending on your usage, 3GB ram is not enough for to turn pagefile to 0MB, especially for VISTA. My advice to you, play around with the size of your virtual memory, including to 0MB, and look at your performance monitor.
You will get an idea of how much RAM you need from there. If you have enough ram that meet your needs, you don't have to use virtual memory.
For me, after I have upgraded to 6GB ram, I can safely turn virtual memory to 0 and NO PROBLEMS. I cannot do this before the upgrade with 2GB.
Windows would use more ram with virtual memory off and so will applications. I do monitor ram usage and so far so good. Yes computer will run faster if you have enough physical RAM not to use swap file. Imaging swapping between RAM and much slower virtual RAM on your hard disk.

It really depends what you use your computer for. If you use your computer to browse the web, you don't need virtual memory with 3GB. But if you do more than surfing the internet with 3GB, you would need virtual memory in case the memory required is more than 3GB of your physical ram.

People who give advice on topic from what they read without actually trying them is not that dependable. Plus people interpret words from what they read differently.


So it would seem from my experience that turning of page file no matter how much ram you have would be bad. Because windows for some reason uses page file even though there is over 2GB of free ram, in my case. It seems that sometimes it maybe better to use the page file over the ram. Maybe because what is in use is not needed at all times and the access time can be slower, doesnt make sense but that is the only reason i could imagine why it would use it instead of the free ram.

At 4GB i would think i could turn off the page file, as i dont think i will go over that. You seem to have no problems with page off?
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: KeypoX
Originally posted by: inhotep
Ok, here is what I have to say about the topic. I have experimented with it, not just reading it. Depending on your usage, 3GB ram is not enough for to turn pagefile to 0MB, especially for VISTA. My advice to you, play around with the size of your virtual memory, including to 0MB, and look at your performance monitor.
You will get an idea of how much RAM you need from there. If you have enough ram that meet your needs, you don't have to use virtual memory.
For me, after I have upgraded to 6GB ram, I can safely turn virtual memory to 0 and NO PROBLEMS. I cannot do this before the upgrade with 2GB.
Windows would use more ram with virtual memory off and so will applications. I do monitor ram usage and so far so good. Yes computer will run faster if you have enough physical RAM not to use swap file. Imaging swapping between RAM and much slower virtual RAM on your hard disk.

It really depends what you use your computer for. If you use your computer to browse the web, you don't need virtual memory with 3GB. But if you do more than surfing the internet with 3GB, you would need virtual memory in case the memory required is more than 3GB of your physical ram.

People who give advice on topic from what they read without actually trying them is not that dependable. Plus people interpret words from what they read differently.


So it would seem from my experience that turning of page file no matter how much ram you have would be bad. Because windows for some reason uses page file even though there is over 2GB of free ram, in my case. It seems that sometimes it maybe better to use the page file over the ram. Maybe because what is in use is not needed at all times and the access time can be slower, doesnt make sense but that is the only reason i could imagine why it would use it instead of the free ram.

At 4GB i would think i could turn off the page file, as i dont think i will go over that. You seem to have no problems with page off?

It's a bad idea, you will only cause yourself more headaches when shit won't work right.

8gb in my system right now, and my page file is 3553/16610M.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
At 4GB i would think i could turn off the page file, as i dont think i will go over that. You seem to have no problems with page off?

Whether you can or not isn't really the point. If you have 4G of memory and aren't going anywhere near that then you're not using the pagefile anyway so disabling it just saves you a bit of disk space and that's not really worth the risk of needing a pagefile and not having one.
 

pallejr

Senior member
Apr 8, 2007
216
0
0
I don't see anything in that post saying a call to a memory allocating function will fail without a paging file, if there is just enough physical ram to back it up. It wouldn't make much sense either to make such a function.
 

inhotep

Senior member
Oct 14, 2004
557
0
0
Originally posted by: KeypoX
Originally posted by: inhotep
Ok, here is what I have to say about the topic. I have experimented with it, not just reading it. Depending on your usage, 3GB ram is not enough for to turn pagefile to 0MB, especially for VISTA. My advice to you, play around with the size of your virtual memory, including to 0MB, and look at your performance monitor.
You will get an idea of how much RAM you need from there. If you have enough ram that meet your needs, you don't have to use virtual memory.
For me, after I have upgraded to 6GB ram, I can safely turn virtual memory to 0 and NO PROBLEMS. I cannot do this before the upgrade with 2GB.
Windows would use more ram with virtual memory off and so will applications. I do monitor ram usage and so far so good. Yes computer will run faster if you have enough physical RAM not to use swap file. Imaging swapping between RAM and much slower virtual RAM on your hard disk.

It really depends what you use your computer for. If you use your computer to browse the web, you don't need virtual memory with 3GB. But if you do more than surfing the internet with 3GB, you would need virtual memory in case the memory required is more than 3GB of your physical ram.

People who give advice on topic from what they read without actually trying them is not that dependable. Plus people interpret words from what they read differently.


So it would seem from my experience that turning of page file no matter how much ram you have would be bad. Because windows for some reason uses page file even though there is over 2GB of free ram, in my case. It seems that sometimes it maybe better to use the page file over the ram. Maybe because what is in use is not needed at all times and the access time can be slower, doesnt make sense but that is the only reason i could imagine why it would use it instead of the free ram.

At 4GB i would think i could turn off the page file, as i dont think i will go over that. You seem to have no problems with page off?

It's not that I seem to have no problems, it is that I do not have problems without pagefile. Yes, windows, by default, will always allocate pagefile no matter how much RAM you have. Just consider it an automatic safety feature. Windows does know what you use your computer for and how much RAM, so it allocate a programmed amount so your apps won't crash from "running low on memory."

Adjusting the pagefile is not recommended because it is for advanced users. I spent time testing and monitoring the performance so I know it is safe for me to do. If my apps are more RAM hungry then I will turn on pagefile or buy more ram. So try it yourself by adjusting the amount of MB allocated to pagefile, which doesn't have to be 0MB.

There are people who say turning pagefile off is stupid, noob, blah blah blah... well first, it maybe the case for their machine. Secondly, if stuff keeps crashing then it would be stupid. Well, my stuff don't crash and no where near that point.

Some people read that it is safe only at 8GB ram. Well, that's not their machine, it's the tester's machine. Just try it yourself, but don't try it if you will work on something important on your computer.
 

gsellis

Diamond Member
Dec 4, 2003
6,061
0
0
Like Brittany, leave the pagefile alone.

The pagefile is actively used by the core OS for crashdump info. If you go blue, that is where most of the info comes from on restart IIRC from OCA discussions.
 

pallejr

Senior member
Apr 8, 2007
216
0
0
a pagefile backed section is just a memory object that can be paged to disk if it becomes neseccary (it won't fail just because there is no paging file). There are other type of objects that can be allocated so they will never be paged out, no matter what.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I understand the difference but according to him, and other places I've seen while discussing the topic, those allocations will indeed fail on versions of Windows previous to Vista.
 

pallejr

Senior member
Apr 8, 2007
216
0
0
This is from the windows internals book by Mark Russinovich:

"Sections mapped to committed memory are called page file backed sections because the pages are written to the paging file if memory demands dictate. (Because Windows can run with no paging file, page file backed sections might in fact be "backed" only by physical memory.)"
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
What version of Windows is he talking about? Because it wasn't even really possible to run Windows without a pagefile until XP and I thought it only worked well with special versions like embedded and PE.
 

pallejr

Senior member
Apr 8, 2007
216
0
0
That was from the book covering 2000, xp and 2003. In the 2000-only book it says the same.
 

inhotep

Senior member
Oct 14, 2004
557
0
0
Originally posted by: Nothinman
What version of Windows is he talking about? Because it wasn't even really possible to run Windows without a pagefile until XP and I thought it only worked well with special versions like embedded and PE.

Oh so after all that, now you know you can turn off virtual memory. Windows 2000 can run without virtual memory too. I've tested it. It gives you warnings about low virtual memory because during those times 512MB is considered A LOT.

And you though it only worked well with special versions like embedded and PE. Well, how about stop assuming shit and listen to the people who have tested and operated their machines without virtual memory?
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: inhotep
Originally posted by: Nothinman
What version of Windows is he talking about? Because it wasn't even really possible to run Windows without a pagefile until XP and I thought it only worked well with special versions like embedded and PE.

Oh so after all that, now you know you can turn off virtual memory. Windows 2000 can run without virtual memory too. I've tested it. It gives you warnings about low virtual memory because during those times 512MB is considered A LOT.

And you though it only worked well with special versions like embedded and PE. Well, how about stop assuming shit and listen to the people who have tested and operated their machines without virtual memory?

You still don't get it. Yes, you can turn off a page file, but you can NOT turn off virtual memory. It's a core component of an operating system. A page file is just a backing store for your virtual memory, just like your physical ram.

You really need to stop calling your page file virtual memory, it's not accurate.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
That was from the book covering 2000, xp and 2003. In the 2000-only book it says the same.

As much as I trust Mark I'm still skeptical because I've seen other developers say otherwise, there's no code snippets that could be used to verify either way is there?

Oh so after all that, now you know you can turn off virtual memory.

No, I don't. In fact I know the exact opposite because I know it's impossible to turn off VM in Windows. Sure if you boot up DOS you won't have a VM enabled but I doubt running a 16-bit OS is worth the trade-off.

And you though it only worked well with special versions like embedded and PE. Well, how about stop assuming shit and listen to the people who have tested and operated their machines without virtual memory?

Because from your posts it's obvious that you don't actually know how the kernel works with regards to memory management.
 

GrumpyMan

Diamond Member
May 14, 2001
5,778
262
136
I've always thought that it doesn't matter whether you turn off the page file in XP because it secretly makes one anyway.
 

pallejr

Senior member
Apr 8, 2007
216
0
0
Originally posted by: NothinmanAs much as I trust Mark I'm still skeptical because I've seen other developers say otherwise, there's no code snippets that could be used to verify either way is there?

Just play a bit with the CreateFileMapping function. http://msdn.microsoft.com/en-u...y/aa366537(VS.85).aspx


Originally posted by: GrumpyMan
I've always thought that it doesn't matter whether you turn off the page file in XP because it secretly makes one anyway.

It doesn't. It may create a small temporary one, if the system gets pushed down under.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |