Thread: RE: [GD-Windows] How to determine total physical memory available ?
Brought to you by:
vexxed72
From: Carsten O. <car...@se...> - 2004-01-26 20:08:29
|
IIRC, GlobalMemoryStatus returns the actual amount of RAM minus the DOS-inherited 640 kB base memory. After actually checking that: Yep, add 640 kB (=3D655360 byte) to the value in xMS.dwTotalPhys and you got the real value. When doing anything of this kind, please consider using = GlobalMemoryStatusEx on Win2k/XP systems. We're not that far from systems having the full 4GB space equipped. Carsten Orthbandt Founder + Development Director SEK SpieleEntwicklungsKombinat GmbH http://www.sek-ost.de Wenn ich Visionen habe, gehe ich zum Arzt. - Helmut Schmidt =20 > -----Original Message----- > From: gam...@li...=20 > [mailto:gam...@li...] On=20 > Behalf Of Yannick Letourneau > Sent: Monday, January 26, 2004 8:47 PM > To: gam...@li... > Subject: [GD-Windows] How to determine total physical memory=20 > available ? >=20 >=20 > I need to determine how much memory is installed on the user's system > somehow. >=20 > I used GlobalMemoryStatus but the values returned in the=20 > member dwTotalPhys > is always underestimating a bit. For example on my dev=20 > machine it returns > 1022 MB although I have 1024 MB installed. Same thing happens on all > systems I've tested. >=20 > Same thing is reported in dxdiag.exe so they seem to use that=20 > function as > well. >=20 > However, when I use the System Information tool in the system tools of > Windows, it correctly reports 1024 MB. >=20 > So anyone knows how I can get the exact information ? >=20 > Yannick L=E9tourneau > UBISOFT >=20 >=20 >=20 > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_idU5 >=20 |
From: Timur D. <ti...@cr...> - 2004-01-26 20:15:57
|
I guess System Information tool just rounds this number to the next = "reasonable" number. It knows that memory chips don't come in 1022Mb setups.. So it`s quite easy to round number you get to closest power of 2.. _____________________ Timur Davidenko. Crytek (http://www.crytek.com) -----Original Message----- From: Yannick Letourneau [mailto:yle...@ub...]=20 Sent: Monday, January 26, 2004 8:47 PM To: gam...@li... Subject: [GD-Windows] How to determine total physical memory available ? I need to determine how much memory is installed on the user's system somehow. I used GlobalMemoryStatus but the values returned in the member = dwTotalPhys is always underestimating a bit. For example on my dev machine it = returns 1022 MB although I have 1024 MB installed. Same thing happens on all systems I've tested. Same thing is reported in dxdiag.exe so they seem to use that function = as well. However, when I use the System Information tool in the system tools of Windows, it correctly reports 1024 MB. So anyone knows how I can get the exact information ? Yannick L=E9tourneau UBISOFT ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_idU5 |
From: Jon W. <hp...@mi...> - 2004-01-26 21:21:22
|
I'm pretty sure that's not what it's doing. DRAM comes in 1 MB modules, and 2MB modules, and 4 MB modules, and ... There is no law that memory comes installed in powers of two, and in fact, two out of my five machines have non-power-of-two configurations (384 and 768). Note that some machines set aside more memory for frame buffer use (Intel Extreme, etc) -- it's un-clear whether you'd WANT to count this towards available memory. If the machine has 256 MB of RAM, but 64 MB of that is taken up for framebuffer and texture memory, then you're really running on a 192 MB machine for all intents and purposes, with a 64 MB graphics card. Except the graphics card and CPU fight for the single memory bus, causing slower performance than you'd otherwise expect out of the "rated" memory subsystem (i e DDR266 performs like PC133). Cheers, / h+ -----Original Message----- From: gam...@li... [mailto:gam...@li...]On Behalf Of Timur Davidenko Sent: Monday, January 26, 2004 12:16 PM To: gam...@li... Subject: RE: [GD-Windows] How to determine total physical memory available ? I guess System Information tool just rounds this number to the next "reasonable" number. It knows that memory chips don't come in 1022Mb setups.. So it`s quite easy to round number you get to closest power of 2.. _____________________ Timur Davidenko. Crytek (http://www.crytek.com) -----Original Message----- From: Yannick Letourneau [mailto:yle...@ub...] Sent: Monday, January 26, 2004 8:47 PM To: gam...@li... Subject: [GD-Windows] How to determine total physical memory available ? I need to determine how much memory is installed on the user's system somehow. I used GlobalMemoryStatus but the values returned in the member dwTotalPhys is always underestimating a bit. For example on my dev machine it returns 1022 MB although I have 1024 MB installed. Same thing happens on all systems I've tested. Same thing is reported in dxdiag.exe so they seem to use that function as well. However, when I use the System Information tool in the system tools of Windows, it correctly reports 1024 MB. So anyone knows how I can get the exact information ? Yannick Létourneau UBISOFT ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_idU5 ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_idU5 |
From: Simon O'C. <si...@sc...> - 2004-01-26 20:38:39
|
Jeffrey Richter's excellent Programming Appplications for Windows (MS = Press) has the following to say about the missing memory in the physical total: "The dwTotalPhys member indicates the total number of bytes of physical memory (RAM) that exist. On this 128-MB Pentium II machine, this value = is 133,677,056, which is just 540,672 bytes under 128 MB. The reason GlobalMemoryStatus does not report the full 128 Mb is that = the system reserves some storage as a nonpaged pool during the boot process. This memory is not even considered available to the kernel. The = dwAvailPhys member indicates the total number of bytes of physical memory available = for allocation." > -----Original Message----- > From: gam...@li...=20 > [mailto:gam...@li...] On=20 > Behalf Of Carsten Orthbandt > Sent: 26 January 2004 20:08 > To: gam...@li... > Subject: RE: [GD-Windows] How to determine total physical=20 > memory available ? >=20 > IIRC, GlobalMemoryStatus returns the actual amount of RAM=20 > minus the DOS-inherited 640 kB base memory. > After actually checking that: Yep, add 640 kB (=3D655360 byte)=20 > to the value in xMS.dwTotalPhys and you got the real value. > When doing anything of this kind, please consider using=20 > GlobalMemoryStatusEx on Win2k/XP systems. We're not that far=20 > from systems having the full 4GB space equipped. >=20 > Carsten Orthbandt > Founder + Development Director > SEK SpieleEntwicklungsKombinat GmbH > http://www.sek-ost.de >=20 > Wenn ich Visionen habe, gehe ich zum Arzt. - Helmut Schmidt > =20 >=20 > > -----Original Message----- > > From: gam...@li... > > [mailto:gam...@li...]=20 > On Behalf Of=20 > > Yannick Letourneau > > Sent: Monday, January 26, 2004 8:47 PM > > To: gam...@li... > > Subject: [GD-Windows] How to determine total physical=20 > memory available=20 > > ? > >=20 > >=20 > > I need to determine how much memory is installed on the=20 > user's system=20 > > somehow. > >=20 > > I used GlobalMemoryStatus but the values returned in the member=20 > > dwTotalPhys is always underestimating a bit. For example on my dev=20 > > machine it returns > > 1022 MB although I have 1024 MB installed. Same thing=20 > happens on all=20 > > systems I've tested. > >=20 > > Same thing is reported in dxdiag.exe so they seem to use=20 > that function=20 > > as well. > >=20 > > However, when I use the System Information tool in the=20 > system tools of=20 > > Windows, it correctly reports 1024 MB. > >=20 > > So anyone knows how I can get the exact information ? > >=20 > > Yannick L=E9tourneau > > UBISOFT > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > The SF.Net email is sponsored by EclipseCon 2004 Premiere=20 > Conference=20 > > on Open Tools Development and Integration See the breadth=20 > of Eclipse=20 > > activity. February 3-5 in Anaheim, CA. > > http://www.eclipsecon.org/osdn > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_idU5 > >=20 >=20 >=20 > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 Premiere=20 > Conference on Open Tools Development and Integration See the=20 > breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_idU5 >=20 > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004 > =20 >=20 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004 =20 |