info needed regarding TSRM thread local storage

php.internals

Kamesh Jayachandran

21 years ago
Hi All, what this MBO_0 mean? I could see the MBO_0 ifdefs removed in 1.62 version of TSRM.c whether this change has got anything to do with memory leak fix. I could see 246888 bytes of leak for each thread. Even the simple <?php echo "hi";?> script causes 60 bytes of leak. Where and when the thread local storage is freed?. With regards Kamesh Jayachandran

Andrey Hristov

21 years ago
Hi, probably MBO_0 stands for MarcusBOerger_0 . I am not sure whether this was somewehere in the coding standards document, but this means that the programmer has commented the code by using the preprocessor. The programmer has to put his name and a suffix _0 . Usually code commented this way is quite experimental and can lead to problems, but was left for some reason. It looks like this. Andrey Kamesh Jayachandran wrote:

Kamesh Jayachandran

21 years ago
Thanks Andrey. I have Apache with worker thread mpm configured. With this MBO_0 macro not defined I get a memory leak of 2,46,888 bytes. With this MBO_0 macro defined I get a memory leak of 51,912 bytes. If I look at the code also it seems that dtor of the resources are called only if MBO_0 macro is defined. Correct me if I am wrong. With regards Kamesh Jayachandran On Thu, 09 Sep 2004 16:30:12 +0200, "Andrey Hristov" <php@hristov.com> said:

Marcus Börger

21 years ago
Hello Kamesh, Thursday, September 9, 2004, 4:37:24 PM, you wrote:
> Thanks Andrey. > I have Apache with worker thread mpm configured. > With this MBO_0 macro not defined I get a memory leak of 2,46,888 bytes. > With this MBO_0 macro defined I get a memory leak of 51,912 bytes. > If I look at the code also it seems that dtor of the resources are > called only if MBO_0 macro is defined.
That's exactly correct. The mistake i did was using 'MBO_0' instead of 'HELLY_0'. The reason this was commented out earlier was that we were too close to a release and decieded to live without that patch until the next release. However your numbers above look wrong. Could you repeat them correctly so i can see the difference between using that code and not using it? marcus

Kamesh Jayachandran

21 years ago
Hi Marcus, That is fine. The leak of 2,46,888 I was getting when I had ldap, mysql and xml extension enabled. After Disabling them and without MBO_0 I had a leak of 87744 bytes. After Disabling them and with MBO_0 I had a leak of 51,912 bytes. Anyway this figures are as given by NetWare System Console which might be bit higher that actual called with malloc or calloc or realloc. With regards Kamesh Jayachandran On Thu, 9 Sep 2004 17:05:32 +0200, "Marcus Boerger" <helly@php.net> said:

Marcus Börger

21 years ago
Hello Kamesh, Thursday, September 9, 2004, 6:00:38 PM, you wrote:
> Hi Marcus, > That is fine. > The leak of 2,46,888 I was getting when I had ldap, mysql and xml > extension enabled. > After Disabling them and without MBO_0 I had a leak of 87744 bytes. > After Disabling them and with MBO_0 I had a leak of 51,912 bytes. > Anyway this figures are as given by NetWare System Console which might > be bit higher that actual called with malloc or calloc or realloc.
Still the comma in your numbers is wrong which makes me think either you copied directly from your system output which would mean your system is bork or you interpreted them or got confused in another way. To me a comma is a thousands separator. That means either there is a comma every third numer or something is wrong - in that case the numbers are of no means at all. If i forget that there are some confusing commas then it seems that the code fixed some memleaks which it was supposed to. Anyway there are obviously more leaks to plug. Maybe there is something wrong in calling the TSRM destruction in netware? marcus

l0t3k

21 years ago
"Kamesh Jayachandran" <kameshj@fastmail.fm> wrote in message news:1094723466.25363.204005102@webmail.messagingengine.com...
> Hi All, > what this MBO_0 mean?
cvs convention around these parts. rather than #ifdef 0, the person doing the #ifdef uses his/her cvs user name appended with "_0". in this case the guilty party appears to be Marcus. i presume he can answer the rest of your questions. l0t3k

Andi Gutmans

21 years ago
At 04:30 PM 9/9/2004 +0200, Andrey Hristov wrote:
> Hi, >probably MBO_0 stands for MarcusBOerger_0 . I am not sure whether this was >somewehere in the coding standards >document, but this means that the programmer has commented the code by >using the preprocessor. The programmer >has to put his name and a suffix _0 . Usually code commented this way is >quite experimental and can lead to problems, >but was left for some reason. >It looks like this.
Yep and he used MBO so that you know who it was :) "Left his mark" Andi