I think your size of your RAM + Virtual memory(allocated swap space) limits
the amount of heap memory available. If while allocating 1 gb, your program
fails when it has allocated 800 mb, it means that its simply has exhausted
its memory space available. As ram cannot be increased without changing the
dimm, you can instead increase your swap space by 200+ mb, and then program
would not crash.

In Linux for example, some extra memory space is set aside for the given
process when its process control block is allocated just to make sure that
if some heap is required that extra space can be used. But at times this
extra space available to process may not be sufficient to fulfill its heap
memory requirements, and then the process has to ask OS for more heap memory
which is then allocated by OS through kernel calls.

On Sat, Jun 19, 2010 at 1:41 PM, Amit Jaspal <[email protected]> wrote:

> @ above
> The heap getting exhausted is with respect to 1 Process only naa. i.e What
> I am trying to ask is Heap Section of Memory is seperate for all processes
> or Same?
>
> So when u say that heap gets exhausted no more dynamic memory can be
> allocated by that process or any other process in the system also can't do
> dynamic memory allocation?
>
>
> On Sat, Jun 19, 2010 at 1:58 PM, harit agarwal <[email protected]>wrote:
>
>> yes you can allocate 1gb using malloc but it also depends on how much heap
>> size is available to you..
>> if you try 2gb then more chances are it won't allocate because of heap is
>> exhausted..
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<algogeeks%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to