B
Berger, Daniel
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C37D64.007DE79E
Content-Type: text/plain
Hi all,
Being as I write a lot of extensions, I've discovered that it's best to
check for memory leaks. The way I'm doing this now is something like this:
# pseudo code
while 1
call some_method
if Linux or BSD
check /proc/Process.pid/fd count
elsif Solaris
check pfiles Process.pid count
elsif Win32
start Task Manager and watch used file descriptors and memory for
Process.pid
end
sleep 1
end
# Ctrl-C to break out of loop only after at least 10 iterations
Is there a better and/or more streamlined way to do this? Any chance of
adding assert_no_memory_leak to TestUnit, for example?
Regards,
Dan
------_=_NextPart_001_01C37D64.007DE79E
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2655.35">
<TITLE>Testing for memory leaks</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2 FACE=3D"Arial">Hi all,</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Being as I write a lot of extensions, =
I've discovered that it's best to check for memory leaks. The way =
I'm doing this now is something like this:</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial"># pseudo code</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">while 1</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> call =
some_method</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> if Linux or =
BSD</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
check /proc/Process.pid/fd count</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> elsif =
Solaris</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
check pfiles Process.pid count</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> elsif Win32</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
start Task Manager and watch used file descriptors and memory for =
Process.pid</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> end</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> sleep 1</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">end</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial"># Ctrl-C to break out of loop only =
after at least 10 iterations</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Is there a better and/or more =
streamlined way to do this? Any chance of adding =
assert_no_memory_leak to TestUnit, for example?</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Regards,</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Dan</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> </FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C37D64.007DE79E--
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C37D64.007DE79E
Content-Type: text/plain
Hi all,
Being as I write a lot of extensions, I've discovered that it's best to
check for memory leaks. The way I'm doing this now is something like this:
# pseudo code
while 1
call some_method
if Linux or BSD
check /proc/Process.pid/fd count
elsif Solaris
check pfiles Process.pid count
elsif Win32
start Task Manager and watch used file descriptors and memory for
Process.pid
end
sleep 1
end
# Ctrl-C to break out of loop only after at least 10 iterations
Is there a better and/or more streamlined way to do this? Any chance of
adding assert_no_memory_leak to TestUnit, for example?
Regards,
Dan
------_=_NextPart_001_01C37D64.007DE79E
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2655.35">
<TITLE>Testing for memory leaks</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2 FACE=3D"Arial">Hi all,</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Being as I write a lot of extensions, =
I've discovered that it's best to check for memory leaks. The way =
I'm doing this now is something like this:</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial"># pseudo code</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">while 1</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> call =
some_method</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> if Linux or =
BSD</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
check /proc/Process.pid/fd count</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> elsif =
Solaris</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
check pfiles Process.pid count</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> elsif Win32</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
start Task Manager and watch used file descriptors and memory for =
Process.pid</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> end</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> sleep 1</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">end</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial"># Ctrl-C to break out of loop only =
after at least 10 iterations</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Is there a better and/or more =
streamlined way to do this? Any chance of adding =
assert_no_memory_leak to TestUnit, for example?</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Regards,</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Dan</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> </FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C37D64.007DE79E--