PDA

View Full Version : 32bit variables and RAM


Aikiman
12-08-2010, 09:19 PM
This is a bit unrelated, but I have a question with memory allocation.
A 32bit computer system simply means it has the capability to assign a variable a 32bit memory address, thats a total 4GB of memory. If I therefore allocate a single variable a 4GB value would this mean at the very least, on a 3GB RAM machine, my variable will be truncated?

And if I had several of these variables at the same time is it likely to cause a crash of some kind?

Robert Bateman
12-09-2010, 10:25 AM
The CRT won't let you have that much memory in 32bit mode in a single allocation. It would just fail to allocate. Typically when you run out of memory, you can fall back to virtual memory (which can be paged out to disk).... So you can go beyond 4Gb, it normally just requires a bit of planning typically.

Aikiman
12-10-2010, 03:27 AM
cool thanks.

uiron
12-10-2010, 07:40 AM
are you sure you can make one application manage 4gb memory on 32bit windows? i sure couldn't get it work even with /3gb switch i think.

Robert Bateman
12-10-2010, 11:11 AM
are you sure you can make one application manage 4gb memory on 32bit windows? i sure couldn't get it work even with /3gb switch i think.

You can't address 4Gb in a 32bit OS, so no it won't work. (Bare in mind the amount of graphics ram and any other devices attached will also be assigned some of that total 4Gb range).

You can (pretend to) utilise more than 4Gb, but you will have to use your own virtual memory scheme. I'm not suggesting that's a better solution than simply installing a 64bit OS....

CGTalk Moderation
12-10-2010, 11:11 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.