07-03-2014 09:27 PM
Hi all,
I am currently looking at a memory leak issue in the TCL UDP socket configuration when the fconfigure command is issued under a procedure.
Under a normal scenario where the socket is configured globally, the system handles the memory well and we do not see an increase.
The folowing examples are not the actual code implemented but provide an example of the condition under which the leak is seen.
set msg [udp_open]
fconfigure $msg -blocking false -buffering none -translation binary -remote [list 10.70.0.112 1234]
proc send {} {
global msg
puts -nonewline $msg "HELLOHELLOHELLOHELLOHELLOHELLOHELLOHELLOHELLO"
return
}
set done 0
while {($done <= 1000)} {
set done [expr {$done + 1}]
after 250
send
}
If we wish do dynamically modify the parameters of the socket, we get an ever increasing consumption of memory (show memory dead - decrease in processor free). for example:
set clients [list]
lappend clients "10.70.0.111 1234"
lappend clients "10.70.0.112 1234"
set msg [udp_open]
fconfigure $msg -blocking false -buffering none -translation binary
proc send {} {
global clients
global msg
foreach peer $clients {
fconfigure $msg -remote $peer
puts -nonewline $msg "HELLOHELLOHELLOHELLOHELLOHELLOHELLOHELLOHELLO"
}
return
}
set done 0
while {($done <= 1000)} {
set done [expr {$done + 1}]
after 250
send
}
I have tested multiple scenatios using flush, return, closing and opening the socket within the procedure, all to the same result - fconfigure in a procedure creates a memory leak in line with the data rate passing through the socket.
I am seeing this across multiple device types and IOS (819,5915,5940,2901,2921,3945) 15 series M/T/GC IOS. I guess the question is, is there a problem with the construct of the procedure in which I am missing something on the channel side to release the memory or does this appear to be a bug?
any help would be appreciated.
Regards,
Robert.
Solved! Go to Solution.
07-06-2014 09:47 PM
This does sound like a bug, but I couldn't find an existing one. I recommend you open a TAC case so this can be analyzed further.
07-06-2014 09:47 PM
This does sound like a bug, but I couldn't find an existing one. I recommend you open a TAC case so this can be analyzed further.
07-06-2014 10:45 PM
Thanks Joseph - Will do.
07-29-2014 07:01 AM
Hi,
could you please tell me the package version number you are using?
You can obtain it by calling "package re udp".
thx
07-29-2014 04:10 PM
Tom,
TCL UDP package is 1.0
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: