cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1556
Views
0
Helpful
4
Replies

Memory Leak in TCL UDP socket

Robert Radford
Level 1
Level 1

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.

 

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

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.

View solution in original post

4 Replies 4

Joe Clarke
Cisco Employee
Cisco Employee

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.

Thanks Joseph - Will do.

tombert75
Level 1
Level 1

Hi,

could you please tell me the package version number you are using?

You can obtain it by calling "package re udp".

 

thx

 

Tom,

TCL UDP package is 1.0

 

Getting Started

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: