RE: [GD-Windows] How to determine total physical memory available ?
Brought to you by:
vexxed72
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 |