memory leaks, 0.54.1 with .2a modifications


I would like to use matplotlib in data acquisition and processing software for a shipboard acoustic Doppler current profiler (ADCP), and I am presently at sea on the University of Hawaii Research Vessel Kilo Moana (25S, 175W). Until June 17 or 18, when I arrive in Honolulu, I will not have access to the mailing list via my normal email address, efiring@...202..., but mail sent to me on the ship, efiring@...201..., will be transferred about 3 times per day.

I am working with a Linux machine, Mandrake 10.0, 2.6 kernel, pygtk 2.2. I suspect that the memory-monitoring parts of the scripts I have attached are Linux-specific.

The attached scripts illustrate what seem to be pervasive memory leaks when doing repeated plots, using GTK or GTKAgg to plot to the screen, or using Agg to make png files only. I have tried several variations--all result in fairly steady increase in memory consumption.

Memory usage increase can also be seen by running the, and repeatedly raising and lowering the window, thereby forcing redraws.

Do you expect that such leakage is inevitable with matplotlib? I hope not; matplotlib is by far the most promising plotting package I have found as a prospective Matlab replacement.

On another topic: I believe I saw in earlier mailing list correspondence a request for transparent plotting of data with NaNs in it--that is, a NaN in a line should cause the line to be broken and a symbol omitted, in pcolor should cause simply an empty (white, black, or transparent) cell, etc., as in Matlab. I would like to second this request. In physical oceanography, bad or missing measurements are ubiquitous, and Matlab's treatment of NaNs enormously reduces the pain of dealing with such glitches. Ideally, this sort of thing would be done equivalently with NaNs in a numarray or with the mask in a masked array, so that one could use either approach.

Thanks for the excellent work you have already done.

Eric Firing
efiring@...201... until June 17
efiring@...202... thereafter (1.02 KB) (1.25 KB)