Orange Forum • View topic - Memory problems with widget signals

Memory problems with widget signals

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

Memory problems with widget signals

Postby EngPedroRafael » Thu Nov 22, 2007 18:36


I've tried this wit the OWFile widget, but it may be happening with other widgets as well.
I have a scrip that measures the memory that the python instance of Orange is using and plots it.
I realized that If I use the "File" widget ( to load a file, the orange instance allocates the memory to the OS to store the data on that file. Now, I delete the widget, and the memory used by the orange's python instance isn't freed up. This is a normal behavior, because python once allocated the memory, even if it frees it, it will not be freed to the OS, but python checks internally as free, so taht it can be used in the future if it needs.
So, after deleted the widget, I loaded the same file again with a new "File" widget and now the python wouldn't request any more memory to the OS, so it has the free memory released by the last "File" widget, but it does, it allocates again the same amount of memory as in the first time, and now I have 1 file and twice the memory needed to handle the data.
You can try yourself, just load a large file, delete the file widget, load again, delete again, ... and some more times ... and you can see, by using the system monitor, your RAM to be consumed till the limit.
I was digging around, in the file, and if I disable the lines that send the signals (self.send(...)), after I delete the widget, I load another file, and it uses the memory freed by the last.
I suspect that this behavior is happening in other widgets as well.
My question is, how the signals are really processed? This test was made with any connection in the out signals, and I discovered that is the self.send(...) directive that is preventing the memory to be freed, and because the widget is deleted, that memory will not be available anymore until the restart of the orange.
Any ideas to overcame this issue??

Return to Bugs