Re: Memory leak detection
| From: | Gustavo Lopes | Date: | Fri, 20 Nov 2009 02:32:29 +0000 |
| Subject: | Re: Memory leak detection | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-6801@lists.php.net to get a copy of this message | ||
On Thu, 19 Nov 2009 11:58:15 -0000, Antony Dovgal <tony@daylessday.org> wrote:
On 19.11.2009 09:19, Gustavo Lopes wrote:Now I do, but it didn't help.Hi, I've read that PHP compiled in debug mode was supposed to warn of memory leaks. I've tried to add an obvious memory leak, but got no messages: (...) void *a = emalloc(200); printf("%d", *((int*)a)); (...)Do you have report_memleaks = On in your php.ini?php.exe 006.php15158708101515870810 (nothing more)php.exe -i | findstr cscriptConfigure Command => cscript /nologo configure.js "--enable-debug" "--enable-crt-debug" Did I do anything wrong?
I would also suggest using valgrind to detect memleaks, but don't forget to --enable-debug and export USE_ZEND_ALLOC=0 env var. Here is the line I use: USE_ZEND_ALLOC=0 valgrind --tool=memcheck --leak-check=yes --num-callers=30 --show-reachable=yes php script.phpThere's no valgrind for windows. I already lost 2 hours with this. I'll try the windows internals list tomorrow. Thanks anyway -- Gustavo Lopes