Unix Programming - Re: what happen to heap on programme exit

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > December 2005 > Re: what happen to heap on programme exit





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: what happen to heap on programme exit
Pascal Bourguignon

2005-12-19, 2:49 am

"apple.davinci" <apple.davinci@gmail.com> writes:

> thanks very much.
> another qusetion:
>
> I had tried this such
> as
>
> while(1)
> {
> char *p = new char[33];
>
> }
>
> when I close the process, I find that the memory can be used is more
> than before I didn't run the process.
>
> any explain.
> I thought when the process is running ,it used some memory which didn't
> belong to it.
> so when it closed and the memory is freed, the memory can be used is
> more than before.
>
> I think it is not a good explain, maybe it is related with some
> knowledge of OS,
> could you give me some tips?


How do you measure the free memory?

Do you realise that unix is a multi-processing OS, that there are a
lot of processes running always at the same time?

To measure the real free memory before and after running a given
process, you would have to suspend all the other processes, including
the shell from which you launch the tested process, and the X server
where the tested process displays its output.


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

"Klingon function calls do not have "parameters" -- they have
"arguments" and they ALWAYS WIN THEM."
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com