![]() |
In which case, realloc returns NULL???
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. |
Re: In which case, realloc returns NULL???
"shahul" <shahul@chellasoft.com> wrote in message news:efYasx$UGHA.4608@tk2msftngp13.phx.gbl... > 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. |
Re: In which case, realloc returns NULL???
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/ |
Re: In which case, realloc returns NULL???
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 |
| All times are GMT. The time now is 10:52 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.