Thread: Theoretical limitations of malloc()?

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    412

    Theoretical limitations of malloc()?

    How much memory could I (in theory) allocate with malloc()?

    Is this only limited by pointer size, and thus able to allocate up to 4 GB? Or are there other limitations (not considering the limitations which are imposed by the amount of memory actually available).

    In other words, if there was an infinite amount of memory available, how much would malloc() let me access, tops?

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    156
    According to David Soloman in "Inside Microsoft WIndows 2000", Windows 2000 implements a virtual memeory system based on a flat (linear) 32-bit address space. Thirty-two bits of address space translates into 4 GB of virtual memory. On most systems, Window 2000 allocates half this address space ( the lower half of the 4-GB virutal address space, from 0x00000000 through x7ffffff) to processes for thier unique private storage and uses the other half (x80000000 to xffffffff) for its own protected operating system memory utilization.

  3. #3
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Good answer. I guess it will change in a couple years or so when we all have I64 processors.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. malloc + segmentation fault
    By ch4 in forum C Programming
    Replies: 5
    Last Post: 04-07-2009, 03:46 PM
  2. Is there a limit on the number of malloc calls ?
    By krissy in forum Windows Programming
    Replies: 3
    Last Post: 03-19-2006, 12:26 PM
  3. Malloc and calloc problem!!
    By xxhimanshu in forum C Programming
    Replies: 19
    Last Post: 08-10-2005, 05:37 AM
  4. malloc() & address allocation
    By santechz in forum C Programming
    Replies: 6
    Last Post: 03-21-2005, 09:08 AM