RAM size!?

This is a discussion on RAM size!? within the C++ Programming forums, part of the General Programming Boards category; Hi there! I've been searching a while with google and found nothing interesting about it... My program needs to know ...

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    13

    Question RAM size!?

    Hi there!

    I've been searching a while with google and found nothing interesting about it... My program needs to know how much RAM memory there is on the system it's running on.

    I'd like some help on this, please!

    Thanks
    Max

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    Start by mentioning which OS and compiler you're using, there is no standard answer.

    > My program needs to know how much RAM memory there is...
    Why does it "need" to know?

    If your program is running on a 32-bit OS, there is only a passing resemblance between the amount of physical RAM in your machine and the amount of virtual memory the OS will give to your program.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    pwns nooblars
    Join Date
    Oct 2005
    Location
    Portland, Or
    Posts
    1,094
    http://msdn.microsoft.com/library/de...moryStatus.asp

    First thing from "Dectecting the amount of memory on a system C++" on google gave me a post saying to look at that fuction. Since you can't really use more ram that what is available, without destablizing other programs, this function should be good enough.

  4. #4
    Registered User
    Join Date
    Dec 2005
    Posts
    13
    I'm on 32bit WinXP with Borland C++ Builder...

  5. #5
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231
    Windows API should has a function to get system info.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Generic heapsort
    By Sephiroth1109 in forum C Programming
    Replies: 15
    Last Post: 12-07-2007, 05:14 PM
  2. Invalid conversion from 'void*' to 'BYTE' help
    By bikr692002 in forum C++ Programming
    Replies: 9
    Last Post: 02-22-2006, 10:27 AM
  3. An exercise in optimization
    By Prelude in forum Contests Board
    Replies: 10
    Last Post: 04-29-2005, 03:06 PM
  4. RAM how do i know?
    By Boomba in forum Tech Board
    Replies: 5
    Last Post: 06-18-2003, 08:17 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21