The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Can a 32-bit program use more than 4 GB of Virtual Memory?

    Discussion in 'Windows OS and Software' started by Apollo13, Nov 29, 2007.

  1. Apollo13

    Apollo13 100% 16:10 Screens

    Reputations:
    1,432
    Messages:
    2,578
    Likes Received:
    210
    Trophy Points:
    81
    See title. I know there's a 4 GB RAM limit, but if I set my page file to 32 GB, can a program use all 32 GB?

    Somehow I'm guessing the answer is no, even with tweaks.

    Are tweaks necessary even to go above 2 GB?

    All assuming a 32-bit OS. I've already set my page file to 5 GB - is this useless given the traditional 4 GB ceiling?
     
  2. odin243

    odin243 Notebook Prophet

    Reputations:
    862
    Messages:
    6,223
    Likes Received:
    0
    Trophy Points:
    205
    No program can use more than 2GB of addresses in a traditional 32-bit setting. Having a pagefile that large is useless, yes, but not because of any 32-bit limit, simply because it's too big to be useful.
     
  3. BrassMouse

    BrassMouse Notebook Evangelist

    Reputations:
    642
    Messages:
    529
    Likes Received:
    0
    Trophy Points:
    30
    Programs handle virtual memory and ram differently, so it should be able to handle a larger page file (someone more knowledgeable about programming should correct me if I'm wrong).

    The 2gb limitation in 32bit windows applys to Ram, and it's a legacy from the early days of windows when this problem was nonexistant (because 2 gigs of ram would have cost about as much as a new house). How it handles memory is tied into the kernel and how drivers run, so changes are difficult and can domino quite easily.
     
  4. Jalf

    Jalf Comrade Santa

    Reputations:
    2,883
    Messages:
    3,468
    Likes Received:
    0
    Trophy Points:
    105
    A 32-bit application can be coaxed into using 4GB, but never more than that.

    It's not just a matter of pulling a few switches, it's a fairly fundamental problem.
    In 32-bit code, each memory address is stored as a 32-bit value. 32 bits only allows you to represent 4 billion different numbers. If each number refers to a byte of RAM, that means the application can keep track of 4 billion bytes, or 4GB of memory.
    More than that would require longer addresses, which 32-bit applications don't have. The application itself only sets aside 32 bits for each memory address, so no matter what the OS does, the app will never be able to address more than 4GB of memory.

    I don't know if Windows can handle pagefiles larger than 4GB. It may be possible (I know Mac's often create a 10+ GB pagefile, so obviously they come up with a few tricks to let the OS itself (not applications running on it) work with more than 4GB. But individual applications are still limited to at most 4GB.
     
  5. odin243

    odin243 Notebook Prophet

    Reputations:
    862
    Messages:
    6,223
    Likes Received:
    0
    Trophy Points:
    205
    Yes, you can have a functional pagefile bigger than 4GB, but it's essentially useless. If you're actually using enough programs simultaneously to require that many memory addresses, then you need to get yourself a 64-bit OS and/or more RAM.
     
  6. jr_

    jr_ Notebook Enthusiast

    Reputations:
    0
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    5
    The limit in 32-bit Windows (including Vista) for programs is 3GB, but one would need to use the 3GB switch.

    In XP changes can be made to the boot.ini file. (Google "3gb switch boot.ini".)

    In Vista this is done via command line: "bcdedit /set IncreaseUserVa 3072".

    This will allow programs to use 3GB while allocating rest for kernal (I use it mostly for Affect Effects.) Some programs may get all not so good and crashy with "large address aware" inabilities. So if **** starts going sour it may be time to change back.

    3GB is the end limit though--until you go beyond 32-bit. Though I think Macs can allocate 3.5GB for applications. Not sure though.
     
  7. odin243

    odin243 Notebook Prophet

    Reputations:
    862
    Messages:
    6,223
    Likes Received:
    0
    Trophy Points:
    205
    I believe you can get up to 4GB address allocation to a single program in the "32-bit" edition of 2003.
     
  8. jimc

    jimc Notebook Consultant

    Reputations:
    130
    Messages:
    269
    Likes Received:
    0
    Trophy Points:
    30
    Virtual memory, no, the maximum is 4GB minus what the OS reserves. Physical memory, it's possible, with PAE (Physical Address Extension) and (on Windows) AWE (Address Windowing Extension) a 32-bit application can use more than 2GB/4GB physical memory, but not all at once, only chucks at once.
     
  9. jr_

    jr_ Notebook Enthusiast

    Reputations:
    0
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    5
    I am not familiar with the server editions. I have heard of a 4GT (4-gigabyte tuning) switch with 32-b 2003, but I do not know what it does or how it works. I do not use it (the software or the switch).

    You are probably correct though, sir.

    Likewise I am not sure how Apple handles virtual memory allocation either.
     
  10. Jalf

    Jalf Comrade Santa

    Reputations:
    2,883
    Messages:
    3,468
    Likes Received:
    0
    Trophy Points:
    105
    You can get Windows to allocate more (At least Vista can be coaxed into giving 3.6GB or more to applications. Although if you do that, Vista starts crashing)

    The 2GB limit is in fact pretty arbitrary.
    The only absolute limitation is that the entire address space per process may not exceed 4GB. And some of this must be allocated to the OS (because the application needs to be able to see at least part of the OS).
    Exactly how the 4GB space is split is up to the OS though.
    By default, Windows splits it 50/50 for historical reasons.
    I believe Linux only takes 1GB for the OS by default, giving 3GB to the application.

    I know with Vista you can override the default behavior, and specify how much memory you want to give to applications (like I said, it starts crashing if you give Vista too little though)
     
  11. odin243

    odin243 Notebook Prophet

    Reputations:
    862
    Messages:
    6,223
    Likes Received:
    0
    Trophy Points:
    205
    Can I ask you a question Jalf? Do you know how 2003 overcomes this issue? I know it's technically an x86-32 OS, but it seems to have PAE enabled at a deeper level possible than in other Microsoft OS's, as it can see a full 4GB of mem though 32-bit XP and Vista can't (even with PAE enabled).
     
  12. Pitabred

    Pitabred Linux geek con rat flail!

    Reputations:
    3,300
    Messages:
    7,115
    Likes Received:
    3
    Trophy Points:
    206
    If the chipset can't support it, it doesn't matter. You can't enable PAE at different levels, it's either enabled, or not. PAE is like a secondary level of memory redirection. 2003 will work with PAE, XP won't, Vista does kind-of. Server 2003 won't see 4GB of RAM on a box that XP or Vista won't see 4GB of RAM on. It's a hardware related issue, not software.

    That said, I have 5GB installed in my desktop machine (see below), and Linux sees all of it through PAE. You get a performance hit, but you have more available memory.
     
  13. odin243

    odin243 Notebook Prophet

    Reputations:
    862
    Messages:
    6,223
    Likes Received:
    0
    Trophy Points:
    205
    Nope, on a 64-bit chipset Vista 32-bit won't see a full 4GB of memory, no matter what. 2003 32-bit will. I've verified this with my own machine.
     
  14. Jalf

    Jalf Comrade Santa

    Reputations:
    2,883
    Messages:
    3,468
    Likes Received:
    0
    Trophy Points:
    105
    Well, the cheesy answer would be "It doesn't, simply shows the total amount of physically installed RAM, rather than the amount of addressable RAM"

    I don't know if that's actually the case, but it would be the easy answer. :D
    Basically, instead of Windows saying "I can see we have 4GB RAM, but we need ~600MB for memory mapping and stuff, so I'll pretend we only have 3.4", it could just say "We have 4GB, so I'll show that, but just mark the first 600MB as "in use"" ;)

    More likely, though, it simply has PAE enabled. Then the OS can see more than 4GB of RAM, although with a performance hit.
    Individual 32-bit applications are still limited to a 4GB address space each though.

    Not sure why XP or Vista don't report the full 4GB available in that case though. As far as I know, both should support PAE.

    So... beats me. PAE could explain it, but then I can't say why XP or Vista can't do the same if you enable PAE on them. If Pitabred is right, that they simply don't support PAE very well, that might be the explanation. But as far as I know, it should be supported on all three OS'es.
     
  15. odin243

    odin243 Notebook Prophet

    Reputations:
    862
    Messages:
    6,223
    Likes Received:
    0
    Trophy Points:
    205
    Yeah, 2003 definitely supports PAE fully, as it shows the full 4GB RAM with the same or less idle usage than XP.
     
  16. ScuderiaConchiglia

    ScuderiaConchiglia NBR Vaio Team Curmudgeon

    Reputations:
    2,674
    Messages:
    6,039
    Likes Received:
    0
    Trophy Points:
    205
    So to use the "extra" memory is it paging it? This takes me back MANY years to the days of the 8080-8088 machines. I believe it was when the 80286 first came out there were memory cards (remember those anyone?) that had "paged" memory. They allowed for more memory than the chip set itself could access, by literally switching banks of memory as I remember. This is all real fuzzy. I believe the applications themselves had to deal with paging, but again this was too many programming paradigms ago to say for sure how it worked.

    Gary
     
  17. odin243

    odin243 Notebook Prophet

    Reputations:
    862
    Messages:
    6,223
    Likes Received:
    0
    Trophy Points:
    205
    Those were actually a segmented "swap" type virtual memory, not very closely related to modern Page Files, but the fundamental idea was the same. However, even though the 286 supported this, very, very few OS's at the time implemented the feature.

    In modern paging techniques, to the best of my knowledge, programs do not at all have to worry about virtual memory, they think that they have a large block of contiguous addresses reserved for them (up to 4GB in 32-bit programs).
     
  18. ScuderiaConchiglia

    ScuderiaConchiglia NBR Vaio Team Curmudgeon

    Reputations:
    2,674
    Messages:
    6,039
    Likes Received:
    0
    Trophy Points:
    205
    And it was precisely that "fundamental idea" that brought back that memory. It also seems to me that you are right the OS didn't implement the feature, it was up to the applications to enable this then "new" type of memory.

    I remember it was a bit of a nightmare.

    Gary
     
  19. Apollo13

    Apollo13 100% 16:10 Screens

    Reputations:
    1,432
    Messages:
    2,578
    Likes Received:
    210
    Trophy Points:
    81
    Thanks! Only one more question. I was reading about this on the ProPhotoWiki (never would've found it without the command line command), and it said,

    So does this mean it's not likely to help even if I enable it? It sounds like most programs couldn't use 3 GB of virtual memory even with the switch (thus also couldn't use 3 GB real memory?).
     
  20. odin243

    odin243 Notebook Prophet

    Reputations:
    862
    Messages:
    6,223
    Likes Received:
    0
    Trophy Points:
    205
    Correct, since Windows traditionally has the 2GB limit for 32-bit programs, most of them are written assuming no more than 2GB will be available, and hence will see no improvement.