System cache windows xp

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
The horse is dead. Stop whipping the poor thing. :p

Drag, Nothinman, Kylef..

Given the nature of your previous posts on this board it should be enough for you to explain this once and be done with it. When Einstein was told that Hitler assembled 100 scientists to refute his theories on relativity he said, (paraphrase) "If I'm wrong it would only take one to prove it".

Goku:
Pick up the book titled "Inside Windows 2000", third edition.
 

imported_goku

Diamond Member
Mar 28, 2004
7,613
3
0
I wasnt talking about System cache, I was talking about the fact the processes fill up the system's ram and ram booster only says "hey I need this ram now so you need to leave" then the processes are moved to the Page file and then it just "dries it's self up" giving you the illusion that you have more memory but now it's actually in the page file. Like I said, I dont use the program because I think I have gain memory, because I already know it shoves it into the pagefile because I have been able to observe it's actions with taskmanager. The program is essentially useful in instances where: you have memory leaks and dont care where the "leaked" memory goes just long as it's not in main memory, you need a lot of memory for a specific program your going to run in a second and have closed practically every process you know of and dont plan on using os specific features or atleast utilizing most of them and finally you have no clue what to do but you system is out of ram and you find this utility so you run it.

Oh BTW it would be nice if you guys read my posts CAREFULLY otherwise there wouldn't be so much confusion. I swear to god you guys proably only read my posts once or half way through and make an assumption. If it was read carefully you guys wouldn't be making remarks like "FYI guys, you've all combined written half a book by now and I don't think goku is going to get it. Give him a "memory optimizer" and send him on his blissful way." or "Who are "they" that are putting things into your memory? Disk cache uses memory but it's essentially free for applications, it doesn't 'push' anything to the pagefile and it is freed almost instantaneously in the case that it's needed by an application. "

I understand you guys are trying to help or atleast I think so but if you guys read what I said carefully you'll see what I'm trying to say. I read my own posts many times JUST to make sure you guys understand what I'm trying to convey.

Edit: I only said Virtual Memory Earlier because I forgot about the difference between the two and when I tried to recall them I simply just thought about the old days and a Window saying Virtual Memory and it increasing the page file or something like that.
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
Originally posted by: goku2100
I wasnt talking about System cache, I was talking about the fact the processes fill up the system's ram and ram booster only says "hey I need this ram now so you need to leave" then the processes are moved to the "Page file or Virtual Memory" how ever you want to call it and then just "dries it's self up" giving the illusion that you have more memory but now you actually it's in "Virtual memory" or "page file". Like I said, I dont use the program because I think I have gain memory, because I already know it shoves it into the pagefile or Virtual memory because I have been able to observe it's actions with taskmanager. The program is essentially useful in instances where: you have memory leaks and dont care where the "leaked" memory goes just long as it's not in main memory, you need a lot of memory for a specific program your going to run in a second and have closed practically every process you know of and dont plan on using os specific features or atleast utilizing most of them and finally you have no clue what to do but you system is out of ram and you find this utility so you run it.

Since I apparently dont know whats the difference between page file and virtual memory, please feel free to "enlighten me" so I dont make anymore "ignorant" statements. The only reason why I call it Page file or Virtual memory is because window's does, in the system properties and settings it says virtual memory so when you look at the C drive you see pagefile.sys which is where virtual memory is stored. That is the only reference I think of when I say virtual memory or page file and nothing else.

Goku:
Pick up the book titled "Inside Windows 2000", third edition.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: Smilin
Originally posted by: goku2100
I wasnt talking about System cache, I was talking about the fact the processes fill up the system's ram and ram booster only says "hey I need this ram now so you need to leave" then the processes are moved to the "Page file or Virtual Memory" how ever you want to call it and then just "dries it's self up" giving the illusion that you have more memory but now you actually it's in "Virtual memory" or "page file". Like I said, I dont use the program because I think I have gain memory, because I already know it shoves it into the pagefile or Virtual memory because I have been able to observe it's actions with taskmanager. The program is essentially useful in instances where: you have memory leaks and dont care where the "leaked" memory goes just long as it's not in main memory, you need a lot of memory for a specific program your going to run in a second and have closed practically every process you know of and dont plan on using os specific features or atleast utilizing most of them and finally you have no clue what to do but you system is out of ram and you find this utility so you run it.

Since I apparently dont know whats the difference between page file and virtual memory, please feel free to "enlighten me" so I dont make anymore "ignorant" statements. The only reason why I call it Page file or Virtual memory is because window's does, in the system properties and settings it says virtual memory so when you look at the C drive you see pagefile.sys which is where virtual memory is stored. That is the only reference I think of when I say virtual memory or page file and nothing else.

Goku:
Pick up the book titled "Inside Windows 2000", third edition.


Originally posted by: goku2100
My point exactally.


That's freaking hilarious stuff.

The people who apparently wrote the front end to whatever app in Windows that calls your swap file "Virtual memory" was a complete moron. Had no clue, or realised that most windows users won't know and won't care about the difference.

Each computer has a certain amount of addressable RAM. In the Wintel platform it is limited by it's 32bit-ness to 4gigs. That's what is known as "Virtual Memory". This is a layer of abstration created so that programmers dont' have to go "I want this amount of physical RAM used up, and this amount of swap space used up". They just go "stick this into memory".

Then it's up to the OS to take the virtual memory and map memory usage efficiently. In Windows 2000 and probably WinXP, the OS is allowed to allocate 2gigs out of 4 gigs to applications. It doesn't matter if you have 128 megs of RAM, 386 megs of ram, or a 1024 megs of ram. It doesn't matter if you have 1gig swap file or 2 gig swap file or a 50meg swap file. Your applications will always see the same amount of RAM aviable.

That way as OS designers figure out more and more effecient ways to utilize memory or hardware guys design new types of memory, each application does not have to be rewritten to utilize it. It simplifies application design and makes it so that applications don't go around stepping on each other's toes.

Page file or swap file and Physical memory is just the physical manifistations that will end up providing the RAM needs of the OS. Weither or not to stick this hunk of 4gigs of Virtual RAM into physical "real" RAM modules on your motherboard or a swap file on you harddisk is, and should, be left up to the discression of the OS. That's what it is there for, so app designers don't have to worry about crap like that. They just make the app, ask the OS for memory space, and the OS gives it to them.

Efficient OS design dictates that if space allows you should always keep the RAM filled up with cache.



I'll try to explain memory managment with a little story.


Lets pretend your the OS, and your desk is physical memory on your motherboard. You have a second much larger kitchen table in the other room, far away on your desk. You have a bunch of filing cabinets in your basement and these represent your actual space on the harddrive were you keep all your programs and records. And down there you have a photocopier.

So your doing quartly finacials, and your sitting at your desk running a calculator adding up all the figures.

You need to do a bunch of calculations and you need to have the the papers laid out in front of you.

So first off you need to figure out were downstairs are the papers you need. So you run downstairs and open up a card catalog that has the location of everything in your basement. If your running a FAT filing system this card catalog would be like your file allocation tables.

So you look up were the info is at. You go and open up the filing cabinate, pull out the paper and make a photocopy of the pages you need. Then you run back up stairs and layout your papers on the desk and begin cranking away at your calculator.

Now if you were a DOS version you would use the pages untill your finished, and you whould just throw them away. This wasn't a big deal, because you only had a very small desk and it didn't make much difference.

But now you have a very big desk. And you've found out that since you multitask, you often would end up throwing away pages, then 10 minutes later you'd need them again! Then you would have to run all the way back downstairs, look up the folder, photocopy the pages, and then go BACK up stairs and then use them. And then just throw them away, then 10 minutes later you'd need them all over!

So obviously that was quite retarding thing to do. It took so freaking long. But now you noticed that since you have a very big desk, you can simply push the old papers out of the way, and keep them around for a while. Then if you need them, then you can just look over the desk and see them and then that is much quicker.

Then on top of that you figured out that instead of just throwing away the old pages, you could sometimes move them to the kitchen table, were you previously only used if you ran out of desk space for big jobs. It was slower then just having everything on one big desk, but desks cost money and old kitchen tables are gigantic and dirt cheap.

But then since now you've developed a intellegent way to handle pages you need to work on, you need to streamline it a bit.

Some pages you use over and over agian, while others you used once and throw away for a long time. (for example if your watching a DVD movie you need to stream from disk space into RAM, but it's not likely you'd need it any time soon. While on the otherhand you're probably going to use info from the explorer.exe's DLL files over and over and over again.)

So how do you tell what peices of paper would be most worth keeping? What should you keep that is valuable, and what is disposable? What can be most efficiently moved from the desk to the kitchen table and what is just worth throwing away? If you throw away the wrong stuff then you just have to run back downstairs and re-photocopy everything, and that IS SO FREAKING SLOW!!!

So you began using little ticks and symbols up in the margins of the pages. You marked down the time, and every few minutes you erase one of the ticks on all the peices of paper. If you use the pages again then you simply put down more ticks. When the pages ran out of ticks, then you know that you can safely remove the pages if you want. You don't always do that, but if you need room then you know which ones you can throw away and you'd probably not need them again for a long time.

Then if you began to run out of room, you just throw away the pages with no ticks. If you begin to run out of room after that, you begin to move pages with a low number of ticks to the kitchen table. If you begin running out of room after that you begin throwing away pages with ticks on them, moving up to pages with the most ticks. If you begin to run out of room after that you run down to the basement and get more leaves for your table, so that you can make the kitchen table bigger (disk swap file) bigger until you run out of leaves to expand your kitchen table.

If you run out of room after that? Well then your just screwed aren't you? (generally you just stop working on a task all together and concentrate on, hopefully, the more important tasks)

But that doesn't happen so much anymore. You've developed a fairly descent system of marking ticks on pages and can effieciently use your desk and table properly.

It may seem pretty anal, but it's a lot better then loosing pages and/or getting them all smudged up and then having a nervious breakdown like the moron next door, Windows 9x. It's still not perfect but's it a lot better then photocopying pages all day!! At least you can get work done fairly fast.

Your main limitation right now is that you can only keep track of so many peices of paper. About 4gigs worth. Anything beyond that you have to use all these different methods to remap stuff, and it's kind of a pain in the butt. But at least your boss is promising a brain transplant later so that you can address in 64bits and remember the location of many many times more papers.

But now your boss shows up, looks at your desk and says: "Geez your desk is full of paper!",
you say: "Well I am only using these pages right here, right now, but I keep those just incase",
you boss says: "Well you need to have lots of desk space (main memory) to get things done quickly"

Then takes his arm and sweeps all your stand-by pages into the incinerator

Then you cry.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I was talking about the fact the processes fill up the system's ram and ram booster only says "hey I need this ram now so you need to leave" then the processes are moved to the "Page file or Virtual Memory" how ever you want to call it and then just "dries it's self up" giving the illusion that you have more memory but now you actually it's in "Virtual memory" or "page file".

A) The pagefile and Virtual Memory are not synonymous, not by a longshot.
B) Processes don't fill up the systems RAM unless you're running a lot of them or you're running something big like photoshop with a huge image open and then I would assume you want photoshop to stay in memory.

Rambooster asks for memory and the OS decides where to get it from, Rambooster never gets to put processes in the pagefile itself. And anyway, processes aren't put in the pagefile when their memory is needed, they're just reused like system cache because they're backed by the binary file on disk and putting them in the pagefile would be pointless since they can be loaded back from the binary in the exact same manner as data from the pagefile.

With your amount of memory all Rambooster does is make NT flush the system cache which hurts performance more than anything. If by chance it did push some user data into the pagefile then all you've done is hurt the performance of whatever was pushed into the pagefile which is most likely some app you had running and then you'll complain because it takes a long time to restore it in 5 minutes.

The program is essentially useful in instances where: you have memory leaks and dont care where the "leaked" memory goes just long as it's not in main memory, you need a lot of memory for a specific program your going to run in a second and have closed practically every process you know of and dont plan on using os specific features or atleast utilizing most of them and finally you have no clue what to do but you system is out of ram and you find this utility so you run it.

If you know you have a memory leak in an application just close it before running something else, that's all you need to do to free it's memory for other things to use.

Since I apparently dont know whats the difference between page file and virtual memory, please feel free to "enlighten me" so I dont make anymore "ignorant" statements. The only reason why I call it Page file or Virtual memory is because window's does, in the system properties and settings it says virtual memory so when you look at the C drive you see pagefile.sys which is where virtual memory is stored. That is the only reference I think of when I say virtual memory or page file and nothing else.

The only place MS refers to the pagefile and virtual memory correctly is in MSDN docs, for some reason they let the UI guys screw it up all over the place. Virtual Memory is the entire available address space to a process. On a 32-bit system the VM size is always 4G with 2G reserved by the kernel, so no matter how much memory you have each process sees 2G of address space available and it's up to the OS how to handle the real allocation of that. The pagefile is just a bucket to store data in temporarily to free up physical memory pages.

Oh BTW it would be nice if you guys read my posts CAREFULLY otherwise there wouldn't be so much confusion.

The confusion is coming from the fact that you don't know how a modern memory manager works.

I understand you guys are trying to help or atleast I think so but if you guys read what I said carefully you'll see what I'm trying to say. I read my own posts many times JUST to make sure you guys understand what I'm trying to convey.

The thoughts you're trying to convey are just plain wrong because you don't understand VM or how memory management is handled.

or "Who are "they" that are putting things into your memory?

It was an attempt at a joke, you're the one being ambiguous and/or incorrect in your posts.

Disk cache uses memory but it's essentially free for applications, it doesn't 'push' anything to the pagefile and it is freed almost instantaneously in the case that it's needed by an application. "

I'm not sure why you quoted that, the statement is true and I see no insults or anything there.
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
It's a subtle difference goku, and given some of your previous posts (which I've read thoroughly - more about that in a sec) I think you probably understand it just fine. However, you are interchanging some terms so it may appear you don't understand. I'm not sure.

Just to clarify/correct/enlighten *once* and *briefly*: The "memory" in virtual memory can also reside in physical memory as well as the pagefile. Virtual memory is NOT the same as pagefile. For instance via virtual memory an application can see 2GB of user memory and 2GB of kernel memory (4GB total). This can happen on a system with 128MB of physical memory and 128MB of pagefile (256MB total).

Answer this:
If Virtual Memory and Pagefile are the same, how do you squeeze 4GB of Virtual Memory into 128MB of pagefile?



The other members posting on this thread have spent considerable time and effort trying to explain things to you. Your last post and the (edited) one before seem to indicate you think that they are wrong and the only reason they don't get it is because they are not reading your posts. That is not the case. Reality is that you are incorrect and this is the reason they don't "get it".

Now when I quoted your whole post and replied very simply with a suggestion to read a book on the topic it wasn't because I didn't read your post. It was because I read it, disagreed with it, but didn't really want to put the effort into explaining it to you when it's been done so many times already. Also, just to clarify for anyone following along: I did not truncate goku's post when I quoted it. He added to it later.

Despite discussing this and similar topics more times than I care to count, I have now hesitantly joined yet another thread on the topic. My posts thus far have been very short since I was tired of this topic before it began.


I would also like to clarify one of the illusions that a "memory optimizer" may present. To quote you:
Oh wait I just realized somin, when I go to task manager and see that my system cache is 300MB it looks like it's all the memory that is in use at the moment but when I use Rambooster and try to free up 1Gb I see the system cache shrink to 33MB and after it's done it stays!
What you are seeing here is Windows memory management trying to anticipate what you are doing. In fact if left alone (no "optimizer") it would have done what you have been after all along. It was using 300MB of system cache since this was a good use of memory at the time (and still is). However you created an artificial need for memory elsewhere.

It is leaving the system cache lower because it is anticipating you needing that again shortly. This is unfortunate because that freed memory would be better used in system cache (you are hurting performance). Had you truly needed that memory for a real app instead of something artificial it still would have given it to you (optimizer or not) so you gained nothing for your app, but lost performance due to lowered system cache.

Use your computer a bit longer and place whatever normal demands on it that you do and it will again adjust the system cache back to a higher level if that memory is not immediately needed elsewhere.

As you can see (I hope, geez) that second guessing the memory management is only going to hurt performance. This is not the only bad side effect either. If you go off cramming a bunch of useless data into a pagefile in order to free physical memory you are also burning up PTEs. Try this on a system that is already heavily using PTEs (running PAE, 3GB or terminal services) and you'll run out of PTEs, start getting Event 2020s or bluescreen your system! Don't blame Windows for it either. If you tell it to, your horse will run till it's heart explodes whether it's for a good reason or an artificial one.


Goku, *please*: Re-read some of the excellent posts already here, read up on this elsewhere on the 'net, or go checkout that book I recommended. Now that I've invested more than a trivial amount of time on this thread the patience bomb has officially begun ticking. :)




 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
Originally posted by: goku2100
More story time!

FYI, When Drag's posts get that long it means he's making one last effort to make you get it. Often when this happens it means he's about 10 seconds away from flaming you.

He lit me up once a couple years ago on something I was being dense about (kinda like you). You don't want to go there.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Drag:

My head started spinning while I read your analogy story. I guess I always did find computers easier than real life situations. :p

Luckily I'm not a life counselor, so this doesn't really matter...
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: Smilin
Originally posted by: goku2100
More story time!

FYI, When Drag's posts get that long it means he's making one last effort to make you get it. Often when this happens it means he's about 10 seconds away from flaming you.

He lit me up once a couple years ago on something I was being dense about (kinda like you). You don't want to go there.

Well I'd like to think that I've calmed down some. I don't like to get to flaming it's just to easy to have a misunderstanding in forums and such, so lots of the time its undeserved. The rest of the time it's silly because it makes it look like I am sitting here screaming going "OMG WTF doesn't he GET?!!!", which is kinda silly.


Currently on my computer I am running with these stats:
Mem: 904884k total, 619240k used, 285644k free, 8360k buffers
Swap: 1052248k total, 94620k used, 957628k free, 386808k cached

It's only been up for 3 days, so I am not suprised that it's still got over a 256 megs free. (I had to reboot to get a BIOS update so I could use my AGP card at 8x speed for my video card. It ran with no agp enabled before that (the drivers won't work at 4x on my board for some reason). Although it was worth rebooting, I got like a 38 percent boost in performance from just that alone.)

A indication of how efficient a memory manager is is how full you can get the memory without having to actively resort to using swap space for your applications. I don't remember how it worked out last time I tried it, I could maybe get it down to 4-6 megs of free space before it start swapping. Just openned a bunch of applications and then allocated a ram disk (tmpfs actually) and started copying files into it...

 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
Drag, That story was great.


Hey kylef, what team you on at MS? You know dclive & Siannath?

 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Originally posted by: Smilin
Hey kylef, what team you on at MS? You know dclive & Siannath?
I work in the Windows Division, under the Networking and Devices org, on the "Network Connected Devices" team. I work on Longhorn mostly. I'm based in Redmond.

I believe I have heard those names around here (I've been a member in the forums here for quite a while, but only intermittently participating). But I didn't know they worked at MS. Bound to run into a few here and there with a company this big. Thanks for the heads up.
 

VirtualLarry

No Lifer
Aug 25, 2001
56,571
10,206
126
Originally posted by: Nothinman
Rambooster really just makes it's self big and shoves everything out
Exactly, which causes things to get pushed into the pagefile that normally wouldn't have needed to go there. So you essentially create slow downs in the long term because 5 minutes after you run Rambooster the OS has to page back in things like explorer or your game that normally would have never needed to be evacutated from memory.

I don't know if this will help Goku understand, but I was dealing with a very memory-constrained situation (before I upgraded my machine from only 256MB to 768MB of RAM, and was swapping like a mofo when running Mozilla for any length of time, under W2K SP2). I decided to try one of those "RAM booster"-type programs, I forgot the exact one but it was a popular one.

I found that, in the short term, after waiting for it to flush the existing contents of RAM to the pagefile, then memory allocation requests made immediately afterwards were also satisfied immediately, but that didn't help, overall. If anything, once I started to use my application again, I had to wait *again* for it to slowly demand-page the data from the pagefile back into RAM to work with it. So overall, the "RAM booster" program was actually slowing things down, by making me wait even longer to "free RAM", even though it immediately got used up again right away, and added additional wait having to read the contents back in from the pagefile. So all it ever did was add a periodic slowdown to an already slow (swapping heavily already) system.

It's really best to just let the OS do its job, with what resources it has available, and if those aren't enough to go around, add some more. (In my case, I was desperately in need of more RAM at the time.)

Yes, I had already read the linked article about "RAM boosters" being snake-oil, and that was my opinion as well, but I thought at the time, "What the heck, it won't cost me anything, and is certainly cheaper than a RAM upgrade. Might as well try it." Clearly, it failed to do anything substantial to improve, and in fact it hurt performance.
 

dclive

Elite Member
Oct 23, 2003
5,626
2
81
Originally posted by: Smilin
Drag, That story was great.


Hey kylef, what team you on at MS? You know dclive & Siannath?

I don't work at MS, it's subsidiaries, or any agency associated with Microsoft. :)
 

Sianath

Senior member
Sep 1, 2001
437
0
0
To be specific Smilin:

Inside Windows 2000, Chapter 7 (Memory Management)
Inside Windows 2000, Chapter 11 (Cache Manager)

He should be set. :)
 

imported_goku

Diamond Member
Mar 28, 2004
7,613
3
0
Wow, you guys may have read everything I SAID but maybe not the whole meaning. Maybe I was thinking somin and yet typing somin else I don't know. Maybe I should summarize what I know already and what I am still wondering:

1. I know that Windows needs system cache because then when a program requests that same exact information agian it can retrieve it.
2. I know what Virtual Memory is and Page file is, its been a while since I have dealt with this and my memory about anything is fading day by day. Virtual memory is essentially all addressable memory an application can use, its called virtual memory because it includes page file and physical memory. So for example the application needs 512MB of ram to run properly so it looks at the system and the system has 256MB of Physical ram and 1024MB of Page file (1024MB Page file because of HDD space restrictions), it does not see 256MB Physical and 1024MB page file, it just sees 4096MB. In the event the program needs more than 1280MB of memory the computer will give you a blue screen because the application doesn't know there are memory restrictions. So windows memory management sees the application's request for 512MB of ram and gives as much physical ram as possible and then diverts all other requests or program info into page file. So now the program's use of ram from windows/users standpoint is 192MB physical ram used and 320MB page file which adds up to 512MB of memory. (Please correct me if I am WRONG, k?)
3. When you buy more ram windows increases it's system cache from maybe 128MB to 256Mb or 512MB because it now has more room to cache and which is good so that less information is paged to the HDD or just dropped.

What I have learned: System cache is essentially free space but for the time being it's being used to store frequently used programs to prevent unnecessary disk access.

Now here are my unanswered questions:

1. About Commit charge (I must have aimed my questions in the wrong direction with the system cache). My real question is, if my system ran smooth as butter with 384MB of ram with the Commit Charge around 128MB (Assuming some ram is to system processes), I then increase the system ram to 1GB and see the commit charge increase to 200MB, I'm wondering is there a way to limit how much Ram is devoted to Windows? Because if the system ran smoothly before with some processes in the page file (Which I was fine with) and then Windows increases the Commit charge to 200MB to get them out of the Page File and I see no performance improvement, shouldn't I be able to recover the wasted Ram since it isn't helping improve performance? You guys might say to let any processes that are able to run from the ram instead of the pagefile is important because the pagefile is much slower but I think "Hey, if letting the process run from the page file isn't going to reduce performance, why not leave it there?"
Edit: I know it hasn't improved performance despite what some say it would because it's just one less disk access and I have observed situations where applications could use more physical ram and instead just move into page file because memory manager thinks windows deserves more resources.

I know that the commit charge isn't all the ram used but most of it and I know that Windows isn't using 200MB of ram because it's shared with other processes in the background.

Edit: I was sleepy last night and agian I should emphasize that it's been a while.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Just for our sake, you probably should crack open a good OS textbook and read the chapter on "virtual memory." Or read those chapters in "Inside Windows 2000." They might help you find the right questions, or possibly even the answers to those questions.
So for example the application needs 512MB of ram to run properly so it looks at the system and it does not see 256MB Physical and 1024MB page file, it just sees 1256MB of ram period.

Not at all. The app has no idea how much memory is on the system. It only "sees" a flat, empty 4 gigabyte address space which is called "virtual memory." Virtual, get it? As in, "it doesn't exist." It turns out that an app can only actually use the first 2 gigabytes of this imaginary memory, but that's a platform-specific limitation (i.e., NT) and not a PC-specific limitation (i.e., 256 mb RAM).

So windows memory management sees the application's request for 512MB of ram and gives as much physical ram as possible and then diverts all other requests or program info into virtual memory.

No! First of all, the app doesn't just request 512 megabytes of RAM as one lump sum. There are 3 ways that an app can cause physical memory to be assigned its virtual address space:
1) The app requests a chunk of memory. Usually these chunks are for buffers or small data structures and are aggregated into large pools called "heaps."
2) The app's code is "demand paged" into memory from disk for execution. This happens several pages at a time. The app is completely unaware this occurs: it's transparent.
3) One of the app's thread stacks overflow its page and the OS "grows" the stack by allocating another page. The app causes the stack to grow, but the allocation of stack space is handled by the OS transparently.

All 3 types of memory allocations occur throughout the lifetime of the app, NOT just at the beginning when the app is launched! So in your hypothetical example, when an app "needs 512 mb", that generally means that its PEAK memory usage during its lifetime (due to 1, 2, and 3) is 512 megabytes. Note also that does not mean that the computer is actually using all 512 megabytes of this memory. In fact, it can probably only access a few pages (4kB each) during the time slice in which it is executing before another thread starts executing (and thus accessing its own, private, virtual pages).

And finally, additional requests are NEVER diverted "into virtual memory"! First of all, I hope you meant to say, "diverted to the pagefile" because virtual memory is NOT the pagefile as we have pointed out many times. But even if you had used the correct term, you would STILL be mistaken. Whenever the app requests memory, the app NEVER receives memory that lives in the pagefile! Since the app currently requesting the memory is the currently active process, the memory manager will page out other apps' memory to disk (Least Recently Used gets recycled first) and give it to the requesting app.

So now the program's use of ram from windows/users standpoint is 192MB physical ram used and 320MB page file which adds up to 512MB virtual memory.

Even if the app had requested the 512 megabytes in a single chunk, it would NEVER have all 192 megabytes of physical RAM assigned to it! First of all, large portions of the OS kernel, drivers, and the "nonpaged pool" live in physical RAM *at all times* during the computer's operation. Let's say that takes up x megabytes of RAM. So you effectively only have (192 - x) megabytes to assign to user programs.

Second of all, only the virtual memory your app has recently accessed will stay assigned to physical RAM. The memory manager constanly tracks WHICH virtual pages currently assigned to physical pages are referenced, and which are not. If a virtual page has not been referenced in quite some time, it becomes a candidate for recycling if necessary! The "Lease Recently Used" (LRU) page is the first one that should be paged to disk and recycled to give to another app if necessary.

(Please correct me if I am WRONG, k?)
K. :)

My real question is, if my system ran smooth as butter with 384MB of ram with the Commit Charge around 128MB (Assuming some ram is to system processes), I then increase the system ram to 1GB and see the commit charge increase to 200MB, I'm wondering is there a way to limit how much Ram is devoted to Windows?

The answer is no, not really. The only reason your commit charge increases when running EXACTLY the same apps on two identical systems with different amounts of RAM, is that the Windows "System" process has dynamically chosen to reserve more memory to hold memory mapped "cache" files. (This is the 2nd part of the system cache I was talking about earlier... the "Standby" cache does NOT get added to the Commit Charge because the pages are never dirty and therefore don't ever need to be paged).

shouldn't I be able to recover the wasted Ram since it isn't helping improve performance?

How do you *know* it isn't helping? Are you SURE those cached files haven't eliminated unnecessary file reads and writes, however small? Are you sure your performance measurements were that good? And if it DID save even ONE read or write, isn't that better than really letting the RAM go unused and empty??

And why do you consider it "wasted" when it WILL be yielded to an app when requested? It's not 'locked' and designated as cache-only! If another app needs the physical memory, the memory manager will take it away from the Cache and give it to the app. If the cache had dirty pages, they would need to be written to disk first: but they will still be yielded on demand!

 

imported_goku

Diamond Member
Mar 28, 2004
7,613
3
0
You guys need to relax and drop the cache thing, I never mentioned anything about the "System cache". Since commit charge is essentially all the memory used, and I know for a fact that more Windows system processes are being added into the ram apposed to the page file. Read my post for the edits but if your too lazy like me, I'll just summ up some edits here:
Edit: I was sleepy last night and agian I should emphasize that it's been a while.
Edit: I know it hasn't improved performance despite what some say it would because it's just one less disk access and I have observed situations where applications could use more physical ram and instead just move into page file because memory manager thinks windows deserves more resources.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Goku,

First of all, it is considered impolite to go back and EDIT your posts to fix misstatements after others have already spent the time to correct you (take for example how "1256" magically became "4096" in your previous post). Just acknowledge your mistakes, rephrase your questions, and move on. Just a little advice so that people will be more willing to help you understand.

I know it hasn't improved performance despite what some say it would because it's just one less disk access and I have observed situations where applications could use more physical ram and instead just move into page file because memory manager thinks windows deserves more resources.

If an application's virtual page is moved from physical RAM to the page file, then the app has not used that page in quite some time. This is the principle of LRU (least recently used) that I was referring to earlier.

The memory manager will ONLY move your app's virtual page from physical RAM to the page file if the following conditions are met:

1) Another app is requesting memory AND
2) there are no zeroed, free, or standby pages available AND
3) your app's page is the least recently used on the system.

In other words, if your app snoozes, it loses [pages].

You guys need to relax and drop the cache thing, I never mentioned anything about the "System cache". Since commit charge is essentially all the memory used, and I know for a fact that more Windows system processes are being added into the ram apposed to the page file.

Heh. Go back and read my last post. I explained EXACTLY why your commit charge increases when you add more RAM but run the same processes. To summarize:
It is *not* because, as you put it, "more Windows system processes are being added..." A *single* process's thread (the cache manager) has chosen to request more RAM because it sees you have more physical RAM. Because this RAM is mapped into the System process and IS pageable, it is included in the Commit Charge. (Again, this is different from Standby cache, which is not pageable and therefore does not get included in the Commit Charge.)
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
We have now whipped the dead horse so bad it's in bloody little chunks and giblets. He ain't gonna get it, and he's not going to go out and do some reading. He now seems to be arguing more over wounded pride than desire for understanding.

Ignorance by choice is stupidity.
 

imported_goku

Diamond Member
Mar 28, 2004
7,613
3
0
The reason why I have choosen to not respond until like now is because my question never was "truely" answered and instead was given the "Runaround". The reason I don't feel like buying the Windows 2000 book is not because I'm not used to reading manuals or books about operating systems is because I'm at least 5 Miles away from anything and I'm not willing to get off my lazy ass and drive down to Barns&Noble.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Your question was answered several times, if you can't see that then we can't help you.
 

imported_goku

Diamond Member
Mar 28, 2004
7,613
3
0
Ok here is my question for one last time, I don't want your opinions on whether or not my opinion is valid or you think what I'm trying to achieve is pointless but here it goes: Since my system ran happily with 384MB of ram and it had a small Commit Charge (Assuming a lot more is paged than with 1GB of ram), is there a way I can make it so Windows Either Pages more or less, depending on my needs. I want to be able to keep window's usage of ram (Operating system wise) to a maximum of something depending on my needs because I dont believe that windows should put more of it's garbage into my ram and waste space if it isn't going to improve my performance. That is all.