|
From: Yoav L. <yo...@co...> - 2008-10-29 12:45:32
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body dir="ltr" bgcolor="#ffffff" text="#000000">
<p style="margin-bottom: 0cm; margin-top: 0pt;"><small>Hi,</small></p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><span
style="font-size: 13px;"><br>
</span><span style="font-size: 13px;"></span></p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><span
style="font-size: 13px;">I made a ming upgrade on my server. Whenever
I create an action (new SWFAction()) longer then 2000 characters I get :<br>
</span><span style="font-size: 13px;"></span></p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><span
style="font-size: 13px;">child pid 2608 exit signal Segmentation fault
(11).</span></p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><span
style="font-size: 13px;">I suspect a memory leak is causing this
problem and it might be related to the problem discussed here.<br>
</span><span style="font-size: 13px;"></span></p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><span
style="font-size: 13px;"><br>
</span><span style="font-size: 13px;"></span></p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><span
style="font-size: 13px;">Thanks, <br>
</span><span style="font-size: 13px;"></span></p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><span
style="font-size: 13px;">Yoav</span><br>
</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><span
style="font-size: 13px;"></span></p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><span
style="font-size: 13px;"></span></p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><span
style="font-size: 13px;"></span></p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><span
style="font-size: 13px;"></span></p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><br>
</p>
<p style="margin-bottom: 0cm; margin-top: 0pt;"><br>
</p>
<blockquote cite="mid:490...@rz..." type="cite">
<pre wrap="">Hi,
sorry I was mostly offline the last few days. I poked a little bit in
the code but haven't found a real solution yet.
For sure is:
1. ming's shape() does not leak (checked via a C testcase)
2. memory usage scales with the number of instances
I have the strong suspicion that the list holding the instances is not
cleared.
Cheers
Klaus
</pre>
<blockquote type="cite">
<pre wrap="">Hi Klaus,
I'm wondering if you have any new about the problem ? (Can you add me
in CC in the bugzilla plz)
Thanks,
Alan
Alan Boudreault wrote:
</pre>
<blockquote type="cite">
<pre wrap="">In fact, replacing the zend_list_insert by
ZEND_REGISTER_RESOURCE........ has the same effect that removing the
zend_list_addref().
Alan
Klaus Rechert wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi Alan,
the __construct function looks like this now:
PHP_METHOD(swfshape, __construct)
{
SWFShape shape = newSWFShape();
int rsrc_id = ZEND_REGISTER_RESOURCE(return_value, shape,
le_swfshapep);
// int rsrc_id = zend_list_insert(shape, le_swfshapep);
object_init_ex(getThis(), shape_class_entry_ptr);
add_property_resource(getThis(), "shape", rsrc_id);
zend_list_addref(rsrc_id);
}
Commenting the zend_list_addref() has no additional effect on memory
usage here.
Thanks
Klaus
</pre>
<blockquote type="cite">
<pre wrap="">Hi Klaus,
I was writing you a comment on bugzilla.... but still waiting the
account creation confirmation... here's what i wrote:
If you comment the following line, in PHP_METHOD(swfshape,
__construct) method:
zend_list_addref(ret);
The destructor is well called (verified with a printf in the
destructor). BUT, the PHP OBJECT doesn't seem to be freed by php
garbage collector. See what i get now:
Beginning of script : 57368 bytes
End of script : 769960 bytes
So, there are still "memory leaks".
Thanks,
Alan
Klaus Rechert wrote:
</pre>
<blockquote type="cite">
<pre wrap="">It is me again ;)
Just dug a little bit in ZEND sources. Using
ZEND_REGISTER_RESOURCE() instead of zend_list_insert() made the
destructor function working. Running again your testcase results in:
End of script : 1012316 bytes
instead of
End of script : 1524912 bytes for Ming 0.4.2.
One little step... :)
Cheers
Klaus
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
just checked your example. You are right PHP leaks. I'm not sure
why... There are destructor functions defined and registered, but
not called at all.
I filed a bug
<a class="moz-txt-link-freetext" href="http://bugs.libming.net/show_bug.cgi?id=74">http://bugs.libming.net/show_bug.cgi?id=74</a>
Thanks
Klaus
</pre>
<blockquote type="cite">
<pre wrap="">Hi guys, i'm wondering if you are aware of this problem using
your extension (or in the php garbage collector) ?
See my script and results: <a class="moz-txt-link-freetext" href="http://pastebin.ca/1231918">http://pastebin.ca/1231918</a>
Do you know why the memory of the php object are not freed ?
Thanks,
Alan
</pre>
</blockquote>
<pre wrap="">-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move
Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win
great prizes
Grand prize is a trip for two to an Open Source event anywhere in
the world
<a class="moz-txt-link-freetext" href="http://moblin-contest.org/redirect.php?banner_id=100&url=/">http://moblin-contest.org/redirect.php?banner_id=100&url=/</a>
_______________________________________________
Ming-devr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Min...@li...">Min...@li...</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/ming-devr">https://lists.sourceforge.net/lists/listinfo/ming-devr</a>
</pre>
</blockquote>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<pre wrap=""><!---->
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
<a class="moz-txt-link-freetext" href="http://moblin-contest.org/redirect.php?banner_id=100&url=/">http://moblin-contest.org/redirect.php?banner_id=100&url=/</a>
_______________________________________________
Ming-devr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Min...@li...">Min...@li...</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/ming-devr">https://lists.sourceforge.net/lists/listinfo/ming-devr</a>
</pre>
</blockquote>
<br>
</body>
</html>
|