excess allocation in heap segment of a process
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > excess allocation in heap segment of a process




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    excess allocation in heap segment of a process  
sam_cit@yahoo.co.in


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-25-07 12:19 PM

Hi Everyone,

We all know that when the stack segment overflows, we get a error
saying stack overflow and the program terminates. A main() calling
itself recursivley results in this,

What happens when the heap segment overflows? when we keep on
allocating dynamic memory in a loop...

Thanks in advance!!!






[ Post a follow-up to this message ]



    Re: excess allocation in heap segment of a process  
Logan Shaw


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-07 06:18 AM

sam_cit@yahoo.co.in wrote:
>  We all know that when the stack segment overflows, we get a error
> saying stack overflow and the program terminates. A main() calling
> itself recursivley results in this,
>
> What happens when the heap segment overflows? when we keep on
> allocating dynamic memory in a loop...

Why would you keep on trying to allocate memory when you are
checking the return value from malloc() (or whatever) and it is
telling you there is no more memory left to allocate?

At any rate, I suppose what would happen is that you would end
up wasting a lot of CPU time.

- Logan





[ Post a follow-up to this message ]



    Re: excess allocation in heap segment of a process  
Bin Chen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-07 06:18 AM

On Apr 25, 6:27 pm, sam_...@yahoo.co.in wrote:
> Hi Everyone,
>
>  We all know that when the stack segment overflows, we get a error
> saying stack overflow and the program terminates. A main() calling
> itself recursivley results in this,
>
> What happens when the heap segment overflows? when we keep on
> allocating dynamic memory in a loop...
>
> Thanks in advance!!!

I think the correct behavior is malloc() returns NULL.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:35 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register