<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://community.activestate.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ActiveState Community Site - spawn in ActivTcl causes memory leak? - Comments</title>
 <link>http://community.activestate.com/forum-topic/spawn-in-activtcl-causes</link>
 <description>Comments for &quot;spawn in ActivTcl causes memory leak?&quot;</description>
 <language>en</language>
<item>
 <title>My mistake, maybe not memory leakage.</title>
 <link>http://community.activestate.com/forum-topic/spawn-in-activtcl-causes#comment-3580</link>
 <description>&lt;p&gt;After try it more times, I found that after minimize the wish and console window, the memory will be decreased.&lt;/p&gt;
&lt;p&gt;So, may be there are no memory leakage, but windows OS is playing some trick.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;mailto:bigstone1998@sina.com&quot;&gt;bigstone1998@sina.com&lt;/a&gt;&lt;/p&gt;
</description>
 <pubDate>Tue, 27 Nov 2007 04:27:59 -0600</pubDate>
 <dc:creator>bigstone1998</dc:creator>
 <guid isPermaLink="false">comment 3580 at http://community.activestate.com</guid>
</item>
<item>
 <title>memory leakage, even afer exp_wait</title>
 <link>http://community.activestate.com/forum-topic/spawn-in-activtcl-causes#comment-3566</link>
 <description>&lt;p&gt;There are still memory leakage, even after I use exp_wait after exp_close.&lt;br /&gt;
The script I tested is shown as following:&lt;br /&gt;
---------------------------&lt;br /&gt;
package require Expect&lt;br /&gt;
spawn ping 172.16.34.1&lt;br /&gt;
expect &quot;Lost&quot;&lt;br /&gt;
exp_close&lt;br /&gt;
exp_wait&lt;/p&gt;
&lt;p&gt;---------------------------&lt;br /&gt;
after &quot;package require Expect&quot;, the memory used by wish84.exe is 8,176 K&lt;br /&gt;
after exp_wait, the memory used by wish84.exe is 8,620K. &lt;/p&gt;
&lt;p&gt;-------------------------------------&lt;br /&gt;
This is the output of the script run in wish shown above:&lt;/p&gt;
&lt;p&gt;-----------------------------------&lt;br /&gt;
(bin) 1 % package require Expect&lt;br /&gt;
5.43&lt;br /&gt;
(bin) 2 % # now, the memory used by wish84.exe is 7,884 K&lt;br /&gt;
(bin) 3 % spawn ping 172.16.34.1&lt;br /&gt;
3796&lt;br /&gt;
(bin) 4 % expect &quot;Lost&quot;&lt;/p&gt;
&lt;p&gt;Pinging 172.16.34.1 with 32 bytes of data:&lt;/p&gt;
&lt;p&gt;Reply from 172.16.34.1: bytes=32 time&amp;lt;1ms TTL=63&lt;/p&gt;
&lt;p&gt;Reply from 172.16.34.1: bytes=32 time&amp;lt;1ms TTL=63&lt;/p&gt;
&lt;p&gt;Reply from 172.16.34.1: bytes=32 time&amp;lt;1ms TTL=63&lt;/p&gt;
&lt;p&gt;Reply from 172.16.34.1: bytes=32 time&amp;lt;1ms TTL=63&lt;/p&gt;
&lt;p&gt;Ping statistics for 172.16.34.1:&lt;/p&gt;
&lt;p&gt;    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),&lt;/p&gt;
&lt;p&gt;(bin) 5 % exp_close&lt;br /&gt;
(bin) 6 % exp_wait&lt;br /&gt;
3796 exp2 0 0 {Can&#039;t read subprocess memory: Â²Ã™Ã—Ã·Â³É¹Â¦ÃÃªÂ³É¡Â£&lt;br /&gt;
child process crashed.}&lt;br /&gt;
(bin) 7 %&lt;br /&gt;
----------------------------------------------&lt;/p&gt;
&lt;p&gt;The OS system is :&lt;br /&gt;
WinXP2002, service pack 2&lt;br /&gt;
ActiveTcl8.4.15.0&lt;/p&gt;
&lt;p&gt;============================&lt;br /&gt;
Thanks for any response :)&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;mailto:bigstone1998@sina.com&quot;&gt;bigstone1998@sina.com&lt;/a&gt;&lt;/p&gt;
</description>
 <pubDate>Mon, 26 Nov 2007 00:10:38 -0600</pubDate>
 <dc:creator>bigstone1998</dc:creator>
 <guid isPermaLink="false">comment 3566 at http://community.activestate.com</guid>
</item>
<item>
 <title>Tcl/expect memory &quot;leak&quot;</title>
 <link>http://community.activestate.com/forum-topic/spawn-in-activtcl-causes#comment-2540</link>
 <description>&lt;p&gt;As noted in the documentation, you should call exp_wait following the close to properly clean up resources.&lt;/p&gt;
</description>
 <pubDate>Thu, 09 Aug 2007 14:02:19 -0500</pubDate>
 <dc:creator>jeffh</dc:creator>
 <guid isPermaLink="false">comment 2540 at http://community.activestate.com</guid>
</item>
<item>
 <title>spawn in ActivTcl causes memory leak?</title>
 <link>http://community.activestate.com/forum-topic/spawn-in-activtcl-causes</link>
 <description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I ran the following snippet on WinXP Pro/SP2 with ActiveTcl8.4.14.0.272572 installed. It is invoked from Command screen with tclsh. By looking at the Task Manager, the tclsh&#039;s memeory usage kept increasing and eventually the system run out of virtual memeoy. Anyone knos why?&lt;/p&gt;
&lt;p&gt;=====================================================&lt;br /&gt;
package require Expect&lt;br /&gt;
exp_internal 1&lt;br /&gt;
set exp::winnt_debug 1&lt;br /&gt;
puts &quot;Version: [info tclversion]&quot;&lt;/p&gt;
&lt;p&gt;while {1} {&lt;br /&gt;
set pid [exp_spawn ipconfig]&lt;br /&gt;
set id $spawn_id&lt;br /&gt;
puts &quot;SID: $id&quot;&lt;/p&gt;
&lt;p&gt;expect {&lt;br /&gt;
        &quot;Mask&quot; {&lt;br /&gt;
                puts &quot;FOUND Mask!!&quot;&lt;br /&gt;
                close -i $id&lt;br /&gt;
               }&lt;br /&gt;
        eof {&lt;br /&gt;
             puts &quot;EOF!!!&quot;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
======================================&lt;/p&gt;
&lt;p&gt;Thanks for any response!&lt;/p&gt;
&lt;p&gt;Jim&lt;/p&gt;
</description>
 <comments>http://community.activestate.com/forum-topic/spawn-in-activtcl-causes#comments</comments>
 <category domain="http://community.activestate.com/forums/activetcl-discussion-0">ActiveTcl discussion</category>
 <category domain="http://community.activestate.com/os/windows-xp-pro">Windows XP Pro</category>
 <pubDate>Fri, 19 Jan 2007 12:27:19 -0600</pubDate>
 <dc:creator>hcchin</dc:creator>
 <guid isPermaLink="false">312 at http://community.activestate.com</guid>
</item>
</channel>
</rss>
