Re: [ZEND-ENGINE-CVS] cvs: Zend / zend.czend.hzend_config.nw.h

From: Date: Tue, 07 Jan 2003 12:25:54 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: Zend / zend.czend.hzend_config.nw.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-760@lists.php.net to get a copy of this message
There are two issues as far as the memory leak goes: 1. Memory Leak Per Executable basis: Once the executable is loaded it holds some memory. Now when the executable is unloaded it may not free the memory expecting that the OS will take care of freeing this. We can live with this memory leak since this comes into picture only on unload and not during script execution. 2. Memory Leak Per Script basis: Once the executable is loaded and everytime a script is executed it uses some memory, not all of which gets freed. This memory leak is what we are worried about. If there is memory leak for every script executed, then the memory usage will keep on growing as we are executing scripts. We have observed this on NetWare. We need to fix this memory leak. Any thoughts? Thanks, Ananth. >>> "Ananth Kesari" <hyanantha@novell.com> 01/07/03 03:15PM >>> Yes. On NetWare there is no concept of processes. Everything is thread centric. There could be a thread group though in which many threads can be grouped. But every "process" that is spawned is treated as thread by NetWare. Also, there is no concept of something like "garbage collector" on NetWare. Also, we cannot indicate to NetWare when to clean up the resources, we have to explicity clean them up. But why is the memory leak intentional in PHP? Is it for speed? But in any case, we are freeing only on destruction and so the operational speed does not get affected due to this. So, we can do the free's while destruction right? Am I correct in my understanding? Thanks, Ananth. >>> Zeev Suraski <zeev@zend.com> 01/07/03 02:31PM >>> We have quite a few 'intentional' leaks in PHP, where we rely on the operating system to clean stuff up for us. Are you saying there's no way to tell NetWare to just annihilate anything that was related to that process (or rather, that you just don't have processes at all?) At 09:29 07/01/2003, Ananth Kesari wrote: >Andi, > >On NetWare, we do not have a concept of Process and having Threads >within them. Everything is per-thread basis here. So, we find on NetWare >that for every script that we execute, the memory leak keeps increasing. >Once this reaches a threshold level, the server hangs and does not serve >any PHP pages. We will then need to restart the server and start all >over again! On production servers the memory leak goes up tremendously >high quite quickly and it means that one may have to do one restart >every other day! And this is definitely not acceptable to our customers. >So, we are concerned about the memory leaks. > >The fix I have made reduces the memory leaks, but it does not remove it >completely. Even with this fix, we see a leak of 13992 bytes by just >loading Apache (configured to load PHP) and unloading it (which unloads >PHP also). This is indeed a big memory leak. > >Can you please throw some light on how we can reduce the leaks >further? > >Thanks, >Ananth. > > >>> Andi Gutmans <andi@zend.com> 01/07/03 02:02AM >>> >At 02:18 AM 1/6/2003 -0700, Ananth Kesari wrote: > >The patch is done to fix some memory leaks. The function >zend_shutdown > >(defined in zend.c) does get called for NetWare from the > >php_module_shutdown function of main.c. Without this patch it leaks >huge > >memory. With this patch, the memory leaks reduce considerably. > > > >In fact, this patch is put in the zend_shutdown function itself. So, >we > >think the patch is in place unless we need to call some other >function > >to free memory. > >Yes you are right. I didn't realize it's in zend_shutdown(). >I don't quite understand why these leaks bother you. They happen once >per-process. It's actually faster to let the operating system nuke them > >than freeing them and then exiting. >Then again, I do agree that for debugging purposes especially when >using >something like purify, it is easier and cleaner when there are no >leaks. > >Andi > > >-- >Zend Engine CVS Mailing List (http://cvs.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > >-- >Zend Engine CVS Mailing List (http://cvs.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.zend-engine.cvs (#760) next »