Memory size

This is a discussion on Memory size within the C Programming forums, part of the General Programming Boards category; hi again here's another question : Write a program to pickup the memory size of your computer and display it ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    21

    Question Memory size

    hi again

    here's another question :


    Write a program to pickup the memory size of your computer and display it on to the screen.



    I read the notes and found that the memory size of the computer is stored at the location 0x413 and 0x414.

    but how could I find this location.....and how could I work with these numbers.



    your help will be appreciated

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    21
    I'm using VC++6.0 on Windows98

    can't we track the virtual memory......or is there no way for doing it

    can u explain me somewhat more about this problem


    anyways thanx for the consideration

    bye

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    32
    yep, it's all windows api. check the msdn, there is an article on how windows handle virtual memory. there is an article about it.

    the way it's done is that there is an api function and a standard win-api structure. u pass a pointer to the structure in the function and it fills it up.

    the structure has the format:

    struct whatever
    {
    total_physical
    free_physical
    total_virtual
    ...
    ...
    }

    check article in msdn for it. sorry i cant help with more details, i dont have vcc on this machine...

    null

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    32
    ok man. here is your info:

    Memory Management Structures
    ========================
    http://msdn.microsoft.com/library/de...emman_2rw3.asp

    hope it helps.

    take care

    null

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    I've used GlobalMemoryStatus(&MemStatus);

    I found that it was not very accurate. Could not track lost mem with it. Windows seems to allocate in small amounts then suddenly free large amounts so I was getting very different results. Sometimes a function would use -ve amounts of mem.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. tools for finding memory leaks
    By stanlvw in forum C++ Programming
    Replies: 4
    Last Post: 04-03-2009, 11:41 AM
  2. memory leaks
    By TehOne in forum C Programming
    Replies: 4
    Last Post: 10-10-2008, 09:33 PM
  3. Find Size Of Dynamic Memory Allocation?
    By appleGuy in forum C++ Programming
    Replies: 7
    Last Post: 06-17-2007, 09:34 AM
  4. Pointer's
    By xlordt in forum C Programming
    Replies: 13
    Last Post: 10-14-2003, 02:15 PM
  5. How do I check memory size after malloc and realloc?
    By electrolove in forum C Programming
    Replies: 3
    Last Post: 02-06-2003, 09:12 AM

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