[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-c-user
Subject:    Re: memory leak in tcpmon !?
From:       "Dimuthu Gamage" <dimuthuc () gmail ! com>
Date:       2007-11-30 3:29:25
Message-ID: a9dcda00711291917w37f36f40x86287e4c48cb6ac0 () mail ! gmail ! com
[Download RAW message or body]

Hi Mark

On Nov 30, 2007 8:18 AM, Mark Nüßler <mark.nuessler@9elements.com> wrote:

> hello users,
>
> when i started playing around with axis2c i found
> it very useful to have tcpmon the ability to
> write to files and added the str_replace function
> in tools\tcpmon\src\tcpmon.c
>
> when i run longer testsessions with axis2 stuff,
> tcpmon uses more and more memory over time.
>
> i am not skilled in detecting leaks ...
>
> using Visual Leak Detector 1.9f [http://dmoulding.googlepages.com/vld]
>
> compiled tcpmon.c (svn 599617) with vld.h and
> got following output, with leaks detected :
>
> Call Stack:
> tools\tcpmon\src\tcpmon.c (370): str_replace
> tcpmon\src\tcpmon.c (240): on_new_entry_to_file
> tcpmon\src\entry.c (480): tcpmon_entry_new_entry_funct
> ....
>
> ohoh mark, feeling guilty ?
>
> i played around with str_replace and looked at line 370
> char *str_return = (char *) malloc(size * sizeof(char));
>
> k, this is what we need to free after returning,
> str_replace is call-by-value with return.
>
> mh ...
>
> i didn't found a nice solution, just using a single
> variable of 'convert' in 'on_new_entry_to_file'
> for each time using the replace function :
>
> convert1 = TCPMON_ENTRY_SENT_HEADERS(entry, env);
> convert1 = str_replace(convert1, "; ", ";\n\t");
> fprintf(file, "%s", convert1);
> free(convert1);
>
> convert2 = str_replace(formated_buffer, "; ", ";\n\t");
> convert3 = str_replace(convert2, "><", ">\n<");
> fprintf(file, "%s", convert3);
> free(convert2);
> free(convert3);
>
> after new compiling, vld does not detect any leaks
>
> so my questions are :
> - does anyone have this kind of memory leak ?

Yea. It was not maintained for a long time.

>
> - any nicer solutions ?


Yea, You can use the more stable java apache tcpmon from
http://ws.apache.org/commons/tcpmon/download.cgi


>
> mfg derMark
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>

[Attachment #3 (text/html)]

Hi Mark<br><br><div class="gmail_quote">On Nov 30, 2007 8:18 AM, Mark Nüßler &lt;<a \
href="mailto:mark.nuessler@9elements.com">mark.nuessler@9elements.com</a>&gt; \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> hello users,<br><br>when i \
started playing around with axis2c i found<br>it very useful to have tcpmon the \
ability to<br>write to files and added the str_replace function<br>in \
tools\tcpmon\src\tcpmon.c<br><br>when i run longer testsessions with axis2 stuff, \
<br>tcpmon uses more and more memory over time.<br><br>i am not skilled in detecting \
leaks ...<br><br>using Visual Leak Detector 1.9f [<a \
href="http://dmoulding.googlepages.com/vld" \
target="_blank">http://dmoulding.googlepages.com/vld </a>]<br><br>compiled tcpmon.c \
(svn 599617) with vld.h and<br>got following output, with leaks detected \
:<br><br>Call Stack:<br>tools\tcpmon\src\tcpmon.c (370): \
str_replace<br>tcpmon\src\tcpmon.c (240): on_new_entry_to_file <br>tcpmon\src\entry.c \
(480): tcpmon_entry_new_entry_funct<br>....<br><br>ohoh mark, feeling guilty \
?<br><br>i played around with str_replace and looked at line 370<br>char *str_return \
= (char *) malloc(size * sizeof(char)); <br><br>k, this is what we need to free after \
returning,<br>str_replace is call-by-value with return.<br><br>mh ...<br><br>i \
didn&#39;t found a nice solution, just using a single<br>variable of \
&#39;convert&#39; in &#39;on_new_entry_to_file&#39; <br>for each time using the \
replace function :<br><br>convert1 = TCPMON_ENTRY_SENT_HEADERS(entry, \
env);<br>convert1 = str_replace(convert1, &quot;; &quot;, \
&quot;;\n\t&quot;);<br>fprintf(file, &quot;%s&quot;, convert1);<br> \
free(convert1);<br><br>convert2 = str_replace(formated_buffer, &quot;; &quot;, \
&quot;;\n\t&quot;);<br>convert3 = str_replace(convert2, &quot;&gt;&lt;&quot;, \
&quot;&gt;\n&lt;&quot;);<br>fprintf(file, &quot;%s&quot;, convert3); \
<br>free(convert2);<br>free(convert3);<br><br>after new compiling, vld does not \
detect any leaks<br><br>so my questions are :<br>- does anyone have this kind of \
memory leak ?</blockquote><div>Yea. It was not maintained for a long time.&nbsp;  \
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>- any nicer solutions \
?</blockquote><div><br>Yea, You can use the more stable java apache tcpmon from  <a \
href="http://ws.apache.org/commons/tcpmon/download.cgi">http://ws.apache.org/commons/tcpmon/download.cgi</a><br><br></div><blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;"> <br><br>mfg \
derMark<br><br><br><br><br><br><br><br><br>---------------------------------------------------------------------<br>To \
unsubscribe, e-mail: <a \
href="mailto:axis-c-user-unsubscribe@ws.apache.org">axis-c-user-unsubscribe@ws.apache.org
 </a><br>For additional commands, e-mail: <a \
href="mailto:axis-c-user-help@ws.apache.org">axis-c-user-help@ws.apache.org</a><br><br></blockquote></div><br>




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic