Computer memory question

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Computer memory question

Post by netmaestro »

What's the best way to celebrate 5 years and 5000 posts? Right! A nice fat noob question! Here it comes...

It's my understanding that a 32bit OS can address up to 4gb of ram, and adding more would be pointless. Someone correct me if that's not right. A 64bit OS can use more, but how much more? 4 more gb for 8 total? Or more? Secondly, If the 64bit OS is running nothing but 32bit applications, can those applications benefit from the memory above 4gb? Or not unless they're compiled targeting 64bits?

Thanks for shedding light on this for me :mrgreen:
BERESHEIT
Thorium
Addict
Addict
Posts: 1308
Joined: Sat Aug 15, 2009 6:59 pm

Re: Computer memory question

Post by Thorium »

For how much memory: http://msdn.microsoft.com/en-us/library/aa366778.aspx

So it's 7-8TB per process and 16TB total for Windows 64bit.
netmaestro wrote:If the 64bit OS is running nothing but 32bit applications, can those applications benefit from the memory above 4gb?
Basicly no. Thats not entirely true because of PAE, but a application would need to be specialy coded to use PAE and thats very rarely the case.
However every 32bit process get 2GB of address space, so you can have several memory intense processes running.
freak
PureBasic Team
PureBasic Team
Posts: 5950
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Computer memory question

Post by freak »

> It's my understanding that a 32bit OS can address up to 4gb of ram, and adding more would be pointless.

Its even less than that. You have to substract the amount of memory on the graphic card as that is mapped into the 4GB address space as well. If you have a 1gb graphic card then any more than 3gb of ram is a waste.

> Secondly, If the 64bit OS is running nothing but 32bit applications, can those applications benefit from the memory above 4gb?

If the application is compiled with the "large address aware" flag (gives you 3gb of user-space on 32bit systems) then the program will get 4gb of user-space memory on a 64bit system instead of just 2gb. In any case, more memory is a benefit if you have two memory-hungry running side by side as you won't have to use disk swapping then. Any free memory is also used as a disk cache making disk access a little faster. But the benefit for a single program (if not compiled as large address aware) is not that big.
quidquid Latine dictum sit altum videtur
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Computer memory question

Post by netmaestro »

Image
BERESHEIT
User avatar
idle
Always Here
Always Here
Posts: 6109
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Computer memory question

Post by idle »

> It's my understanding that a 32bit OS can address up to 4gb of ram, and adding more would be pointless.

Anymore than 2 Gb is more or less pointless it would seem, considering that you can only normally allocate 2Gb per process unless you take a big stick and thrash it to give you more.
zogre
New User
New User
Posts: 7
Joined: Fri Jun 18, 2010 1:55 pm

Re: Computer memory question

Post by zogre »

freak wrote:>
Its even less than that. You have to substract the amount of memory on the graphic card as that is mapped into the 4GB address space as well. If you have a 1gb graphic card then any more than 3gb of ram is a waste.
This is interesting, since I have a 2gb VGA card and a total of 3gb physical mem of which 1gb is used for a ramdisk, still leaving me around 1.8gb.

netmaestro - I will be using 12gb of ram on Win XP (32bit) soon, ofcourse this is only possible because 8GB of it will be a ramdisk, the ramdisk software I use has a mode called "unmanaged memory" which allows access to the mem above the 3.2/4gb limit on 32bit XP or 32bit Win7.
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: Computer memory question

Post by Josh »

if you have 4gb ram on a 32bit system, windows xp use 2gb and you have only 2gb for your applications. in the boot.ini you can set the 3gb-switch. in this case, only 1gb is reserved for windows.

i think, this is only for xp and i don't know, how this is managed on other windows-os.
sorry for my bad english
Thorium
Addict
Addict
Posts: 1308
Joined: Sat Aug 15, 2009 6:59 pm

Re: Computer memory question

Post by Thorium »

Josh wrote:if you have 4gb ram on a 32bit system, windows xp use 2gb and you have only 2gb for your applications. in the boot.ini you can set the 3gb-switch. in this case, only 1gb is reserved for windows.

i think, this is only for xp and i don't know, how this is managed on other windows-os.
Thats wrong.
Dont confuse virtual memory with physical memory. every process on a 32bit os with flat memory model (all 32bit windows versions, linux, etc.) have a 4 gb address space regardless of how much physical memory is on the system, even if there are only 16mb physical memory. the lower 2gb of that address space are for user mode, normal applications. the upper 2gb are vor kernel mode, drivers, windows kernel, etc.
The OS memory manager mapps portions of physical memory and swap diskmemory to the virtual memory if memory is requested by the app (allocated).
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Computer memory question

Post by blueznl »

zogre wrote:
freak wrote:>
Its even less than that. You have to substract the amount of memory on the graphic card as that is mapped into the 4GB address space as well. If you have a 1gb graphic card then any more than 3gb of ram is a waste.
This is interesting, since I have a 2gb VGA card and a total of 3gb physical mem of which 1gb is used for a ramdisk, still leaving me around 1.8gb.

netmaestro - I will be using 12gb of ram on Win XP (32bit) soon, ofcourse this is only possible because 8GB of it will be a ramdisk, the ramdisk software I use has a mode called "unmanaged memory" which allows access to the mem above the 3.2/4gb limit on 32bit XP or 32bit Win7.
Interesting, what ramdisk software is that?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply