In which case, realloc returns NULL???

Discussion in 'Windows 64bit' started by shahul, Mar 30, 2006.

  1. shahul

    shahul Guest

    hi pals,

    My win32 console application has allocated memory of 350MB in Memory usage
    column and 400MB in Virtual memory column. While reallocating a global
    variable , getting NULL if the size is too high (say 200MB). What is the
    maximum memory size that an application can use? What are the scenario, that
    realloc returns NULL.


    @ Shahul.
     
    shahul, Mar 30, 2006
    #1
    1. Advertising

  2. "shahul" <> wrote in message
    news:efYasx$...
    > hi pals,
    >
    > My win32 console application has allocated memory of 350MB in Memory
    > usage
    > column and 400MB in Virtual memory column. While reallocating a global
    > variable , getting NULL if the size is too high (say 200MB). What is the
    > maximum memory size that an application can use? What are the scenario,
    > that
    > realloc returns NULL.


    *alloc uses heap memory. What you would need is VirtualAlloc then. But
    still, a win32 app, cannot address more memory than 4GB (even if you have
    installed more hardware RAM). However, in practise, this memory never will
    go beyond 2GB unless you use specific hardware & software extensions
    (windows (win32) enterprise edition can address 64 GYG)

    Still, if you allocate that much virtual memory, your swap disk, really gets
    stressed. I would redesign your solution. If you are talking about a
    database table, or something like that that uses that much memory, use a
    cursor mechanism.
     
    Egbert Nierop \(MVP for IIS\), Mar 30, 2006
    #2
    1. Advertising

  3. Hi shahul!

    > My win32 console application has allocated memory of 350MB in Memory usage
    > column and 400MB in Virtual memory column. While reallocating a global
    > variable , getting NULL if the size is too high (say 200MB). What is the
    > maximum memory size that an application can use? What are the scenario, that
    > realloc returns NULL.


    If there is no continues chunck of memory in the requested size. See:

    How to get the largest available continues memory block
    http://blog.kalmbachnet.de/?postid=9


    --
    Greetings
    Jochen

    My blog about Win32 and .NET
    http://blog.kalmbachnet.de/
     
    Jochen Kalmbach [MVP], Mar 30, 2006
    #3
  4. On Thu, 30 Mar 2006 18:48:27 +0530, shahul wrote:

    > hi pals,..


    You're NOT making any "pals" by crossposting to groups that have nothing to
    do with your post. See the link below for information on how to use
    newsgroups properly.

    Shame on the MVPs who crossposted their responses and set no follow up. Of
    course, if you're using a sad newsreader like OE or Thunderbird...

    Follow up set to:

    microsoft.public.win32.programmer.directx.sdk


    --
    Please read this before replying:
    1. Dshow & posting help: http://tmhare.mvps.org/help.htm
    2. Trim & respond inline (please don't top post or snip everything)
    3. Benefit others: follow up if you are helped or you found a solution
     
    The March Hare [MVP], Mar 30, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mel

    Null Route

    Mel, Jan 11, 2004, in forum: Cisco
    Replies:
    1
    Views:
    2,308
    Hansang Bae
    Jan 11, 2004
  2. Matt

    AS5800 null routes

    Matt, Jan 28, 2004, in forum: Cisco
    Replies:
    0
    Views:
    369
  3. Martin Bilgrav

    PIX Firewall - PDM Null Rule ?

    Martin Bilgrav, Feb 20, 2004, in forum: Cisco
    Replies:
    0
    Views:
    2,719
    Martin Bilgrav
    Feb 20, 2004
  4. sqrfolkdnc

    Making V.35 F/F crossover null modem

    sqrfolkdnc, Mar 12, 2005, in forum: Cisco
    Replies:
    0
    Views:
    1,141
    sqrfolkdnc
    Mar 12, 2005
  5. Jim
    Replies:
    2
    Views:
    2,608
Loading...

Share This Page