File: memleak_nongui.py

package info (click to toggle)
matplotlib 2.0.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 91,640 kB
  • ctags: 29,525
  • sloc: python: 122,697; cpp: 60,806; ansic: 30,799; objc: 2,830; makefile: 224; sh: 85
file content (19 lines) | stat: -rw-r--r-- 399 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
from matplotlib.figure import Figure
from matplotlib.cbook import report_memory


def plot():
    fig = Figure()
    i = 0
    while True:
        print(i, report_memory(i))
        fig.clf()
        ax = fig.add_axes([0.1, 0.1, 0.7, 0.7])
        ax.plot([1, 2, 3])
        i += 1

if __name__ == '__main__':
    plot()