Tk Library Source Code

View Ticket
Login
Ticket UUID: 1445219
Title: BWidget Notebook memory leak?
Type: Bug Version: None
Submitter: erickb Created on: 2006-03-07 23:36:23
Subsystem: bwidget Assigned To: damonc
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2009-06-26 22:19:06
Resolution: Fixed Closed By: oehhar
    Closed on: 2009-06-26 15:19:06
Description:
I'm using the BWidget NoteBook widget, and having a
problem with memory. When I open a new tab, wish takes
more memory (that's fine). But when I close the tab,
wish also takes more memory. I would have expected it
to release memory (or at least stay constant, although
that's not desirable), but instead, the memory
footprint grows.

I'm working in Windows XP using ActiveTcl 8.4.10.1.
[And I'm looking at the "virtual memory" size in the
Task Manager (which gives a pretty reliable reading),
and not "Memory Usage" (which is inaccurate). It seems
to be a real effect, and not just a problem with the
way Windows calculates memory use.]
User Comments: oehhar added on 2009-06-26 22:19:06:
Its true, two variables are left.
I fixed that in cvs.

erickb added on 2006-03-13 07:38:12:
Logged In: YES 
user_id=816411

My mistake. I've still got a memory leak, but a more careful
look shows me that it's not the BWidgets notebook widget.

However, the notebook does seem to leave some info in data()
after deleting, as you suggest. This seems to clean it up
without side-effects:

    # Clear out page-related info
    foreach ndx [array names data -glob "*$page*"] {
        unset data($ndx)
    }

Thanks, and sorry about the incorrect diagnosis.

nobody added on 2006-03-13 04:28:12:
Logged In: NO 

Proc NoteBook::delete might profit from a line like:
unset data($page,width)
although I am not sure this solves the trouble.