Dynamic memory in Unix
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 > Dynamic memory in Unix




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

    Dynamic memory in Unix  
my_gaurav@yahoo.com


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


 
12-17-04 12:45 AM

Hi

Just wanted to know some details about the dynamic memory allocation in
Unix. When I start process a.out how exactly heap is allocated by the
kernel and is there any limit on the size of the heap.

Another thing is that when I do a free() or delete() the released
memory is not returned back to kernel ??

Regards,
Gaurav






[ Post a follow-up to this message ]



    Re: Dynamic memory in Unix  
Barry Margolin


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


 
12-17-04 12:45 AM

In article <1103188103.928484.50910@c13g2000cwb.googlegroups.com>,
my_gaurav@yahoo.com wrote:

> Hi
>
> Just wanted to know some details about the dynamic memory allocation in
> Unix. When I start process a.out how exactly heap is allocated by the
> kernel and is there any limit on the size of the heap.

Look up "break" in any book or web page on Unix internals.

>
> Another thing is that when I do a free() or delete() the released
> memory is not returned back to kernel ??

Usually true.  Since the heap segment can only be grown or shrunk at one
end, the memory could only be returned if it happened to be at the end
of the segment.  I think the GNU libc free() checks for this, but most
don't.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***





[ Post a follow-up to this message ]



    Re: Dynamic memory in Unix  
David Schwartz


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


 
12-17-04 12:45 AM


<my_gaurav@yahoo.com> wrote in message
news:1103188103.928484.50910@c13g2000cwb.googlegroups.com...

> Another thing is that when I do a free() or delete() the released
> memory is not returned back to kernel ??

Physical memory or virtual memory? Physical memory is always released to
the kernel unless you specifically lock it. Virtual memory is not a scarce
resource, so why would you care whether it's released or not?

DS







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:03 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