Memory leak, what does it mean?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
What does this me?

/usr/ports/lang/php5-cli/work/php-5.0.5/main/streams/streams.c(1209) :  Freeing
0x083AC564 (1 bytes), script=/home/webmaster/allphp/main.php
/usr/ports/lang/php5-cli/work/php-5.0.5/ext/standard/file.c(472) : Actual locati
on (location was relayed)
Last leak repeated 5 times
=== Total 6 memory leaks detected ===

Is it my script or is it php?  The script output appears
correct.  Should I do something?

Lars Eighner
 It's important for us to explain to our nation that life is important. It's  
 not only life of babies, but it's life of children living in, you know, the  
 dark dungeons of the Internet.--G.W. Bush, Arlington Heights, Ill.,10/24/00

Re: Memory leak, what does it mean?

Lars Eighner wrote:

Quoted text here. Click to load it


A memoryleak means something like this:
(Mostly coded in C, and in very simple terms)
1) A process wants some bytes to store information (for example a variable)  
and asks the kernel to allocate them on behalf of that process.

2) Process does its thing, probably using that just allocated memoryspace.

3) Because of some unexpected behaviour or a plain bug the process ends  
without telling the kernel to free the memory it allocated for the process.
(under normal circumstances the process WILL tell the kernel to free the  

4) Memory will be allocated to a process that is gone. So no other process  
can use that memory, hence the name memoryleak.

What you should do about it?
I would report it at
It is probably way too complex for yourself to fix.

Be sure you give them a detailed report, possibly with an example where it  
You are helping the development of PHP a lot by filing bugs!

Erwin Moller

Re: Memory leak, what does it mean?

Quoted text here. Click to load it

Actually it asks a function in the runtime library, eg. /usr/lib/libc.*.so or  

Quoted text here. Click to load it

Actually the OS kernal will free the memory on most systems, but as you say  
the leak indicates a malfunction that may have worse conseqqquences.

Quoted text here. Click to load it



Site Timeline