Hi Tom.

> 
> OK, try this one:
> #define TWENTY_GIG (1024*1024*20)
> main()
> {
>    void *x = malloc(TWENTY_GIG);  /* 20 Gig */
>    memset(x, 0, TWENTY_GIG-1);
>    free(x);
>    sleep(100);
> }
> 
> FYI - Threads are part of the process image.  
> Their memory is part of the whole process.  Just because
> a thread exits doesn't mean the memory it allocated
> goes away.

OK, this I didn't know.

> 
> It clearly sounds to me that the page you run every five minutes
> is the cause of your memory leak.  If it is the only thing running,
> then you have you culprit.

This means that a CFML file that gets requested every 5 minutes just eats up
all available memory (and even the complete swap space if we let it run long
enough).

I do not yet understand why this happens. If (with Linux) a process
allocates 1 MB, frees it and then malloc's 1 MB again, the first memory
chunk is reused !

Only if the application still uses it and has not freed it this won't work.


So what can we do with our regular scripts running all the time ?
The only way to get around this would be a kind of CFFREE - Tag.
Or do you expect some code in this CFML file to make CF think that the data
is still needed and so not freeing it ?



On a side note:

Why does apache, a threaded webserver, work so well ?
It never grows above approx 5MB even if it hands out GBytes of data.

I think it will use the standard malloc also.

Thanks for your answer, 

-- 
Christoph Gr�ver, [EMAIL PROTECTED]

Sitepark
Gesellschaft f�r Informationsmanagement mbH
Rothenburg 14-16
D-48143 M�nster

Telefon (0251) 482 65 -50
Telefax (0251) 482 65 -39

http://www.sitepark.de
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-linux%40houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_linux or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to