heap allocation & kill signal
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 > heap allocation & kill signal




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

    heap allocation & kill signal  
gaurish.panse@gmail.com


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


 
01-23-07 12:31 PM

1. How does the OS (*nix) keeps track of the heap memory allocated to
each
process? If the OS knows the memory consumed by each process, does it
automatically releases the memory upon process termination/kill? if
not, why not  ?

2. What happens when SIGKILL is issued on a process? What clean up the
OS does?

TIA

~ gau






[ Post a follow-up to this message ]



    Re: heap allocation & kill signal  
Pascal Bourguignon


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


 
01-23-07 12:31 PM

gaurish.panse@gmail.com writes:

> 1. How does the OS (*nix) keeps track of the heap memory allocated to
> each
> process? If the OS knows the memory consumed by each process, does it
> automatically releases the memory upon process termination/kill? if
> not, why not  ?
>
> 2. What happens when SIGKILL is issued on a process? What clean up the
> OS does?

Quite interesting questions.  You'll learn a great deal answering them...

You can either read some books, there are very good unix books,
or read the sources of some unix kernel. You've got the choice between
a number of them, ranging from linux, freebsd and other *bsd, minix,
mach, etc.  I assume you're able to find these sources on the web...

--
__Pascal Bourguignon__                     http://www.informatimago.com/

"By filing this bug report you have challenged the honor of my
family. Prepare to die!"





[ Post a follow-up to this message ]



    Re: heap allocation & kill signal  
SM Ryan


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


 
01-25-07 12:19 AM

gaurish.panse@gmail.com wrote:
# 1. How does the OS (*nix) keeps track of the heap memory allocated to
# each
# process? If the OS knows the memory consumed by each process, does it
# automatically releases the memory upon process termination/kill? if
# not, why not  ?

The system knows all pages in your virtual memory. The simplest and
oldest way to extend the data segment is the break value (brk() or
sbrk()). Unices are also now offering more direct control for VM maps.
A process's pages are released when it exits, but those pages might
be shared and remain with other processes. IPC shared memory segments
remain until deleted.

# # 2. What happens when SIGKILL is issued on a process? What clean up the
# OS does?

It does something akin to forcing an _exit call.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
The whole world's against us.





[ Post a follow-up to this message ]



    Sponsored Links  




 





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