|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-04-24 09:29 UTC] jakub at icewarp dot com
I have seen a few threads about Memory leaks in the COM object implementation here but from what I see this has never been solved. For instance this little piece of code proves it:
$excel=new COM("Excel.Application");
for ($i=0;$i<50000;$i++) $excel->sheetsinnewworkbook= "1";
die();
It's not always a property that causes the memory leak. It's also the method you call when you pass strings to it. Also when you try to reference a property that does not exist. I'm using my own COM object to test it with and 5000 cycles o calling a simple 3 string parameter function uses up to 30MB of RAM.
Please try to fix it. We have to use a CGI mode where every instance of PHP is freed completely. But we want to use the ISAPI it is not possible to do that now. Thank you
Jakub
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 12:00:01 2025 UTC |
I was wrong about the _DllMain@12 it is called by Windows automatically. However I have found for instance this. If you load the ISAPI module and free it in a cycle again it does not free the memory. for ($i=0;$i<1000;$i++) { lh = loadlibrary("...isapi.dll"); freelibrary(lh); } After 200 cycles the process consumes 50MB. I don't think that should happen. What is wrong?I have been digging more into this issue and I have found this. 1. HttpExtensionProc like this does not leak at all. DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) { return 0; } 2. 1. HttpExtensionProc like this does leak. DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) { TSRMLS_FETCH(); ts_free_thread(); return 0; } It is clear that the ts_free_thread does not free everything. I'm not a C/C++ guru please people help here. This issue has been here since 2 years ago and nobody fixed it yet. Let me know. Jakub