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

From: Date: Mon, 06 Jan 2003 09:18:00 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: Zend / zend.c zend.hzend_config.nw.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-753@lists.php.net to get a copy of this message
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. Thanks, Ananth. >>> Andi Gutmans <andi@zend.com> 01/04/03 01:38PM >>> At 02:59 PM 1/2/2003 +0000, Anantha Kesari H Y wrote: >Index: Zend/zend.c >diff -u Zend/zend.c:1.167 Zend/zend.c:1.168 >--- Zend/zend.c:1.167 Tue Dec 31 10:55:00 2002 >+++ Zend/zend.c Thu Jan 2 09:59:11 2003 >@@ -618,6 +618,24 @@ > #ifndef ZTS > zend_shutdown_constants(); > #endif >+#ifdef NETWARE >+ /* All the below lines added to remove memory leaks! >+ * They all add up to a big no. Wondering how come it is missed in >the original code! >+ */ >+ /* Removes a leak of 160 bytes */ >+ destroy_zend_class(&zend_standard_class_def); /* Destroys the >hash tables also */ >+ /* Removes a leak of 56 bytes */ >+ zend_hash_destroy(&EG(persistent_list)); >+ /* Removes a leak of 20,440 bytes */ >+ zend_hash_destroy(EG(zend_constants)); >+ /* Removes a leak of 56 bytes */ >+ free(EG(zend_constants)); >+ /* Removes a leak of 20,440 bytes */ >+ zend_hash_destroy(GLOBAL_CONSTANTS_TABLE); >+ /* Removes a leak of 56 bytes */ >+ free(GLOBAL_CONSTANTS_TABLE); >+ /* Removes a leak of 496 bytes */ >+#endif /* NetWare */ > } > This should not be needed. It seems that your code for some reason doesn't call zend_shutdown(). Please revert your patch and try and find the cause for this problem. Thanks, Andi

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