Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Windows 64bit > In which case, realloc returns NULL???

Reply
Thread Tools

In which case, realloc returns NULL???

 
 
shahul
Guest
Posts: n/a
 
      03-30-2006
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.




 
Reply With Quote
 
 
 
 
Egbert Nierop \(MVP for IIS\)
Guest
Posts: n/a
 
      03-30-2006

"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.


 
Reply With Quote
 
 
 
 
Jochen Kalmbach [MVP]
Guest
Posts: n/a
 
      03-30-2006
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/
 
Reply With Quote
 
The March Hare [MVP]
Guest
Posts: n/a
 
      03-30-2006
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorted Returns List and Reversed Returns Iterator ++imanshu Python 7 08-23-2008 04:25 AM
Hash#select returns an array but Hash#reject returns a hash... Srijayanth Sridhar Ruby 19 07-02-2008 12:49 PM
createImage sometime returns null and sometime returns non-null. vizlab Java 3 10-17-2007 11:21 AM
Microcontrollers: which one ? which language ? which compiler ? The Jesus of Suburbia NZ Computing 2 02-11-2006 06:53 PM
block returns and hash element returns Trans Ruby 2 11-06-2005 12:15 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57