You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
1
(36) |
2
(10) |
3
(8) |
4
|
5
(4) |
6
(15) |
7
(17) |
8
(3) |
9
(8) |
10
(5) |
11
(2) |
12
(5) |
13
(5) |
14
(15) |
15
(3) |
16
(10) |
17
(6) |
18
(2) |
19
(1) |
20
(11) |
21
(33) |
22
(13) |
23
(14) |
24
(15) |
25
(4) |
26
(5) |
27
(9) |
28
(12) |
29
(7) |
30
(8) |
31
(6) |
|
ok look like a missing font on my box. Will see... Xavier > I installed the necessary stuff in my LaTeX installation from here: > > http://www.unruh.de/DniQ/latex/unicode/ > > and it's now working even when usetex is on. > > It would be great to figure out why it's broken for you. > > Do you get any error output from LaTeX? > > Cheers, > Mike > > Michael Droettboom wrote: > >> I should clarify, I have this working with the TkAgg backend and >> "text.usetex : False". If "text.usetex : True", I can't confirm or deny >> whether that works since I don't have a proper LaTeX ucs.sty setup here >> to test with. >> >> As an aside, if you're looking to Gtk as a way around this, the Gtk >> backend uses the same rendering pipeline for text when text.usetex is >> True, so it likely will produce the same result. >> >> Cheers, >> Mie >> >> Michael Droettboom wrote: >> >>> Xavier Gnata wrote: >>> >>>> With a = u"é" I get no error but also nothing as a title. No strange >>>> characters. Nothing. >>>> >>> This is working for me with the latest svn version, as well as 0.90.1, >>> on Linux with Python 2.5 and Tcl/Tk 8.4. >>> >>> There are other things that could be going wrong. The encoding of >>> your terminal may not match your default encoding in your Python >>> interpreter. If you're using Linux, can you please send the output of: >>> >>> > locale >>> > python -c "import locale; print locale.getpreferredencoding()" >>> >>> If all is working correctly, you should get the following in your >>> python interpreter: >>> >>> >>> a = u"é" >>> >>> ord(a) >>> 233 >>> >>> If you're using an editor (i.e. not using pylab interactively), you'll >>> need to make sure that it is outputting in the correct encoding, and >>> respecting the >>> >>> # -*- coding: utf-8 -*- >>> >>> line. Recent versions of emacs do this, but I can't really speak for >>> others. >>> >>> I have attached a test script that works for me. It even includes >>> some Greek characters as Unicode which work if you select a Unicode >>> font with those characters. >>> >>> Cheers, >>> Mike >>> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- ############################################ Xavier Gnata CRAL - Observatoire de Lyon 9, avenue Charles André 69561 Saint Genis Laval cedex Phone: +33 4 78 86 85 28 Fax: +33 4 78 86 83 86 E-mail: gn...@ob... ############################################
hm, i was setting it after i imported pylab. You were right. I just now tried calling matplotlib.use("Agg") just before import pylab, and that did give me better results. wxAgg did start leaking memory very quickly, and ps,svg, and pdf were all holding constant - until i hit around loop number 440, at which point they all started growing at about the same rate as the wxAgg was -Luke On 8/9/07, Eric Firing <ef...@ha...> wrote: > Luke, > > Just to be sure: how are you selecting the backend? > > If you use the "matplotlib.use('Agg')" method, this must appear *before* > importing pylab for the first time; it is something of a "gotcha" that > if it appears after pylab has been imported it doesn't give you any clue > that it is ineffective. > > Eric > > > Luke Robison wrote: > > I *am* able to see the same leak in 0.90.1 using Agg, Pdg, Ps, and > > Svg with the same memory amount being leaked each time, so its > > probably in matplotlib code, although I do not have the SVN sources to > > check it there to see if it has been fixed there. I was originally > > using the wxAgg backend, but during the batch job really all i needed > > was the actual histogram numbers, so I looked through the code and > > found matplotlib.mlab.hist which is all I really need, and doesn't > > leak ;-). > > > > Thanks for the help, > > Luke Robison > > > > > > On 8/9/07, Michael Droettboom <md...@st...> wrote: > >> There have been a number of memory leaks resolved since the 0.90.1 > >> release. However, there are still known memory leaks in all of the GUI > >> backends, some of which are unfortunately just beyond easy reach of > >> matplotlib. If this is an automated process and you only care about the > >> file output, you could try using the "Agg", "Pdf", "Ps" or "Svg" > >> backends, e.g.: > >> > >> import matplotlib > >> matplotlib.use("Agg") > >> > >> I tried your script with both 0.90.1 and the latest svn, and I could > >> reproduce your leak with the TkAgg backend, but not with the Agg backend. > >> > >> If you need a GUI, you may want to try using the latest svn version if > >> you can. The leaks still exist there, but they are much smaller. > >> > >> BTW -- you can get the version of matplotlib with: > >> > >> >>> import matplotlib > >> >>> matplotlib.__version__ > >> '0.90.1' > >> > >> Cheers, > >> Mike > >> > >> > >> Luke Robison wrote: > >>> I'm writing a program that processes ~ 25,000 jobs and each iteration > >>> draws a histogram and writes out some of the output. I let it run all > >>> night and when I came back, python was filling up all my memory > >>> (2Gigs) and was thrashing on and off of swap. I narrowed the problem > >>> down to my calling of the hist() function, and was able to reproduce > >>> it in the following code I copied from the mpl website. > >>> > >>> Am I not properly closing the figure somehow? > >>> Has this issue already been addressed? > >>> > >>> I recently installed version 0.90.1 of matplotlib, although I don't > >>> see any easy way to verify that version number from within python. > >>> > >>> -Luke Robison > >>> > >>> > >>> Code: > >>> ------------------- > >>> import os,time,sys > >>> from pylab import * > >>> > >>> def report_memory(i): > >>> pid = os.getpid() > >>> a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines() > >>> print i, ' ', a2[1], > >>> return int(a2[1].split()[1]) > >>> > >>> # take a memory snapshot on indStart and compare it with indEnd > >>> indStart, indEnd = 100, 150 > >>> for i in range(indStart,indEnd): > >>> ind = arange(100) > >>> xx = rand(len(ind)) > >>> > >>> figure(1) > >>> hist(xx) > >>> close(1) > >>> > >>> # wait a few cycles for memory usage to stabilize > >>> if i==indStart: start = val > >>> if i>indStart: > >>> end = val > >>> print 'Average memory consumed per loop: %1.4fk bytes' % \ > >>> ((end-start)/float(indEnd-indStart)) > >>> > >>> ----------------- > >>> > >>> Output: > >>> > >>> > >>> python memtest.py > >>> > >>> Average memory consumed per loop: 0.0000k bytes > >>> 102 39808 21991 > >>> Average memory consumed per loop: 0.0000k bytes > >>> 103 39828 21991 > >>> Average memory consumed per loop: 0.0000k bytes > >>> 104 39852 22024 > >>> Average memory consumed per loop: 0.6600k bytes > >>> 105 39876 22024 > >>> Average memory consumed per loop: 0.6600k bytes > >>> 106 39908 22024 > >>> Average memory consumed per loop: 0.6600k bytes > >>> 107 39932 22024 > >>> Average memory consumed per loop: 0.6600k bytes > >>> 108 39960 22024 > >>> Average memory consumed per loop: 0.6600k bytes > >>> 109 39980 22057 > >>> Average memory consumed per loop: 1.3200k bytes > >>> 110 40008 22057 > >>> Average memory consumed per loop: 1.3200k bytes > >>> 111 40032 22057 > >>> Average memory consumed per loop: 1.3200k bytes > >>> 112 40056 22057 > >>> Average memory consumed per loop: 1.3200k bytes > >>> 113 40084 22057 > >>> Average memory consumed per loop: 1.3200k bytes > >>> 114 40104 22090 > >>> Average memory consumed per loop: 1.9800k bytes > >>> 115 40132 22090 > >>> Average memory consumed per loop: 1.9800k bytes > >>> 116 40156 22090 > >>> Average memory consumed per loop: 1.9800k bytes > >>> 117 40180 22090 > >>> Average memory consumed per loop: 1.9800k bytes > >>> 118 40208 22090 > >>> Average memory consumed per loop: 1.9800k bytes > >>> 119 40232 22123 > >>> Average memory consumed per loop: 2.6400k bytes > >>> 120 40256 22123 > >>> Average memory consumed per loop: 2.6400k bytes > >>> 121 40280 22123 > >>> Average memory consumed per loop: 2.6400k bytes > >>> 122 40304 22123 > >>> Average memory consumed per loop: 2.6400k bytes > >>> 123 40328 22123 > >>> Average memory consumed per loop: 2.6400k bytes > >>> 124 40356 22123 > >>> Average memory consumed per loop: 2.6400k bytes > >>> 125 40380 22156 > >>> Average memory consumed per loop: 3.3000k bytes > >>> 126 40404 22156 > >>> Average memory consumed per loop: 3.3000k bytes > >>> 127 40428 22156 > >>> Average memory consumed per loop: 3.3000k bytes > >>> 128 40452 22156 > >>> Average memory consumed per loop: 3.3000k bytes > >>> 129 40476 22156 > >>> Average memory consumed per loop: 3.3000k bytes > >>> 130 40500 22189 > >>> Average memory consumed per loop: 3.9600k bytes > >>> 131 40528 22189 > >>> Average memory consumed per loop: 3.9600k bytes > >>> 132 40548 22189 > >>> Average memory consumed per loop: 3.9600k bytes > >>> 133 40576 22189 > >>> Average memory consumed per loop: 3.9600k bytes > >>> 134 40596 22189 > >>> Average memory consumed per loop: 3.9600k bytes > >>> 135 40624 22222 > >>> Average memory consumed per loop: 4.6200k bytes > >>> 136 40652 22222 > >>> Average memory consumed per loop: 4.6200k bytes > >>> 137 40676 22222 > >>> Average memory consumed per loop: 4.6200k bytes > >>> 138 40700 22222 > >>> Average memory consumed per loop: 4.6200k bytes > >>> 139 40724 22222 > >>> Average memory consumed per loop: 4.6200k bytes > >>> 140 40744 22222 > >>> Average memory consumed per loop: 4.6200k bytes > >>> 141 40768 22255 > >>> Average memory consumed per loop: 5.2800k bytes > >>> 142 40800 22255 > >>> Average memory consumed per loop: 5.2800k bytes > >>> 143 40824 22255 > >>> Average memory consumed per loop: 5.2800k bytes > >>> 144 40848 22255 > >>> Average memory consumed per loop: 5.2800k bytes > >>> 145 40872 22255 > >>> Average memory consumed per loop: 5.2800k bytes > >>> 146 40896 22288 > >>> Average memory consumed per loop: 5.9400k bytes > >>> 147 40916 22288 > >>> Average memory consumed per loop: 5.9400k bytes > >>> 148 40940 22288 > >>> Average memory consumed per loop: 5.9400k bytes > >>> 149 40972 22288 > >>> Average memory consumed per loop: 5.9400k bytes > >>> > >>> > >>> as you can see, the memory consumption is increasing each loop, and > >>> furthermore, and an increasing rate :-( > >>> > >>> ------------------------------------------------------------------------- > >>> This SF.net email is sponsored by: Splunk Inc. > >>> Still grepping through log files to find problems? Stop. > >>> Now Search log events and configuration files using AJAX and a browser. > >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ > >>> _______________________________________________ > >>> Matplotlib-users mailing list > >>> Mat...@li... > >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >> > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
Luke, Just to be sure: how are you selecting the backend? If you use the "matplotlib.use('Agg')" method, this must appear *before* importing pylab for the first time; it is something of a "gotcha" that if it appears after pylab has been imported it doesn't give you any clue that it is ineffective. Eric Luke Robison wrote: > I *am* able to see the same leak in 0.90.1 using Agg, Pdg, Ps, and > Svg with the same memory amount being leaked each time, so its > probably in matplotlib code, although I do not have the SVN sources to > check it there to see if it has been fixed there. I was originally > using the wxAgg backend, but during the batch job really all i needed > was the actual histogram numbers, so I looked through the code and > found matplotlib.mlab.hist which is all I really need, and doesn't > leak ;-). > > Thanks for the help, > Luke Robison > > > On 8/9/07, Michael Droettboom <md...@st...> wrote: >> There have been a number of memory leaks resolved since the 0.90.1 >> release. However, there are still known memory leaks in all of the GUI >> backends, some of which are unfortunately just beyond easy reach of >> matplotlib. If this is an automated process and you only care about the >> file output, you could try using the "Agg", "Pdf", "Ps" or "Svg" >> backends, e.g.: >> >> import matplotlib >> matplotlib.use("Agg") >> >> I tried your script with both 0.90.1 and the latest svn, and I could >> reproduce your leak with the TkAgg backend, but not with the Agg backend. >> >> If you need a GUI, you may want to try using the latest svn version if >> you can. The leaks still exist there, but they are much smaller. >> >> BTW -- you can get the version of matplotlib with: >> >> >>> import matplotlib >> >>> matplotlib.__version__ >> '0.90.1' >> >> Cheers, >> Mike >> >> >> Luke Robison wrote: >>> I'm writing a program that processes ~ 25,000 jobs and each iteration >>> draws a histogram and writes out some of the output. I let it run all >>> night and when I came back, python was filling up all my memory >>> (2Gigs) and was thrashing on and off of swap. I narrowed the problem >>> down to my calling of the hist() function, and was able to reproduce >>> it in the following code I copied from the mpl website. >>> >>> Am I not properly closing the figure somehow? >>> Has this issue already been addressed? >>> >>> I recently installed version 0.90.1 of matplotlib, although I don't >>> see any easy way to verify that version number from within python. >>> >>> -Luke Robison >>> >>> >>> Code: >>> ------------------- >>> import os,time,sys >>> from pylab import * >>> >>> def report_memory(i): >>> pid = os.getpid() >>> a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines() >>> print i, ' ', a2[1], >>> return int(a2[1].split()[1]) >>> >>> # take a memory snapshot on indStart and compare it with indEnd >>> indStart, indEnd = 100, 150 >>> for i in range(indStart,indEnd): >>> ind = arange(100) >>> xx = rand(len(ind)) >>> >>> figure(1) >>> hist(xx) >>> close(1) >>> >>> # wait a few cycles for memory usage to stabilize >>> if i==indStart: start = val >>> if i>indStart: >>> end = val >>> print 'Average memory consumed per loop: %1.4fk bytes' % \ >>> ((end-start)/float(indEnd-indStart)) >>> >>> ----------------- >>> >>> Output: >>> >>> >>> python memtest.py >>> >>> Average memory consumed per loop: 0.0000k bytes >>> 102 39808 21991 >>> Average memory consumed per loop: 0.0000k bytes >>> 103 39828 21991 >>> Average memory consumed per loop: 0.0000k bytes >>> 104 39852 22024 >>> Average memory consumed per loop: 0.6600k bytes >>> 105 39876 22024 >>> Average memory consumed per loop: 0.6600k bytes >>> 106 39908 22024 >>> Average memory consumed per loop: 0.6600k bytes >>> 107 39932 22024 >>> Average memory consumed per loop: 0.6600k bytes >>> 108 39960 22024 >>> Average memory consumed per loop: 0.6600k bytes >>> 109 39980 22057 >>> Average memory consumed per loop: 1.3200k bytes >>> 110 40008 22057 >>> Average memory consumed per loop: 1.3200k bytes >>> 111 40032 22057 >>> Average memory consumed per loop: 1.3200k bytes >>> 112 40056 22057 >>> Average memory consumed per loop: 1.3200k bytes >>> 113 40084 22057 >>> Average memory consumed per loop: 1.3200k bytes >>> 114 40104 22090 >>> Average memory consumed per loop: 1.9800k bytes >>> 115 40132 22090 >>> Average memory consumed per loop: 1.9800k bytes >>> 116 40156 22090 >>> Average memory consumed per loop: 1.9800k bytes >>> 117 40180 22090 >>> Average memory consumed per loop: 1.9800k bytes >>> 118 40208 22090 >>> Average memory consumed per loop: 1.9800k bytes >>> 119 40232 22123 >>> Average memory consumed per loop: 2.6400k bytes >>> 120 40256 22123 >>> Average memory consumed per loop: 2.6400k bytes >>> 121 40280 22123 >>> Average memory consumed per loop: 2.6400k bytes >>> 122 40304 22123 >>> Average memory consumed per loop: 2.6400k bytes >>> 123 40328 22123 >>> Average memory consumed per loop: 2.6400k bytes >>> 124 40356 22123 >>> Average memory consumed per loop: 2.6400k bytes >>> 125 40380 22156 >>> Average memory consumed per loop: 3.3000k bytes >>> 126 40404 22156 >>> Average memory consumed per loop: 3.3000k bytes >>> 127 40428 22156 >>> Average memory consumed per loop: 3.3000k bytes >>> 128 40452 22156 >>> Average memory consumed per loop: 3.3000k bytes >>> 129 40476 22156 >>> Average memory consumed per loop: 3.3000k bytes >>> 130 40500 22189 >>> Average memory consumed per loop: 3.9600k bytes >>> 131 40528 22189 >>> Average memory consumed per loop: 3.9600k bytes >>> 132 40548 22189 >>> Average memory consumed per loop: 3.9600k bytes >>> 133 40576 22189 >>> Average memory consumed per loop: 3.9600k bytes >>> 134 40596 22189 >>> Average memory consumed per loop: 3.9600k bytes >>> 135 40624 22222 >>> Average memory consumed per loop: 4.6200k bytes >>> 136 40652 22222 >>> Average memory consumed per loop: 4.6200k bytes >>> 137 40676 22222 >>> Average memory consumed per loop: 4.6200k bytes >>> 138 40700 22222 >>> Average memory consumed per loop: 4.6200k bytes >>> 139 40724 22222 >>> Average memory consumed per loop: 4.6200k bytes >>> 140 40744 22222 >>> Average memory consumed per loop: 4.6200k bytes >>> 141 40768 22255 >>> Average memory consumed per loop: 5.2800k bytes >>> 142 40800 22255 >>> Average memory consumed per loop: 5.2800k bytes >>> 143 40824 22255 >>> Average memory consumed per loop: 5.2800k bytes >>> 144 40848 22255 >>> Average memory consumed per loop: 5.2800k bytes >>> 145 40872 22255 >>> Average memory consumed per loop: 5.2800k bytes >>> 146 40896 22288 >>> Average memory consumed per loop: 5.9400k bytes >>> 147 40916 22288 >>> Average memory consumed per loop: 5.9400k bytes >>> 148 40940 22288 >>> Average memory consumed per loop: 5.9400k bytes >>> 149 40972 22288 >>> Average memory consumed per loop: 5.9400k bytes >>> >>> >>> as you can see, the memory consumption is increasing each loop, and >>> furthermore, and an increasing rate :-( >>> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Splunk Inc. >>> Still grepping through log files to find problems? Stop. >>> Now Search log events and configuration files using AJAX and a browser. >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
I *am* able to see the same leak in 0.90.1 using Agg, Pdg, Ps, and Svg with the same memory amount being leaked each time, so its probably in matplotlib code, although I do not have the SVN sources to check it there to see if it has been fixed there. I was originally using the wxAgg backend, but during the batch job really all i needed was the actual histogram numbers, so I looked through the code and found matplotlib.mlab.hist which is all I really need, and doesn't leak ;-). Thanks for the help, Luke Robison On 8/9/07, Michael Droettboom <md...@st...> wrote: > There have been a number of memory leaks resolved since the 0.90.1 > release. However, there are still known memory leaks in all of the GUI > backends, some of which are unfortunately just beyond easy reach of > matplotlib. If this is an automated process and you only care about the > file output, you could try using the "Agg", "Pdf", "Ps" or "Svg" > backends, e.g.: > > import matplotlib > matplotlib.use("Agg") > > I tried your script with both 0.90.1 and the latest svn, and I could > reproduce your leak with the TkAgg backend, but not with the Agg backend. > > If you need a GUI, you may want to try using the latest svn version if > you can. The leaks still exist there, but they are much smaller. > > BTW -- you can get the version of matplotlib with: > > >>> import matplotlib > >>> matplotlib.__version__ > '0.90.1' > > Cheers, > Mike > > > Luke Robison wrote: > > I'm writing a program that processes ~ 25,000 jobs and each iteration > > draws a histogram and writes out some of the output. I let it run all > > night and when I came back, python was filling up all my memory > > (2Gigs) and was thrashing on and off of swap. I narrowed the problem > > down to my calling of the hist() function, and was able to reproduce > > it in the following code I copied from the mpl website. > > > > Am I not properly closing the figure somehow? > > Has this issue already been addressed? > > > > I recently installed version 0.90.1 of matplotlib, although I don't > > see any easy way to verify that version number from within python. > > > > -Luke Robison > > > > > > Code: > > ------------------- > > import os,time,sys > > from pylab import * > > > > def report_memory(i): > > pid = os.getpid() > > a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines() > > print i, ' ', a2[1], > > return int(a2[1].split()[1]) > > > > # take a memory snapshot on indStart and compare it with indEnd > > indStart, indEnd = 100, 150 > > for i in range(indStart,indEnd): > > ind = arange(100) > > xx = rand(len(ind)) > > > > figure(1) > > hist(xx) > > close(1) > > > > # wait a few cycles for memory usage to stabilize > > if i==indStart: start = val > > if i>indStart: > > end = val > > print 'Average memory consumed per loop: %1.4fk bytes' % \ > > ((end-start)/float(indEnd-indStart)) > > > > ----------------- > > > > Output: > > > > > > python memtest.py > > > > Average memory consumed per loop: 0.0000k bytes > > 102 39808 21991 > > Average memory consumed per loop: 0.0000k bytes > > 103 39828 21991 > > Average memory consumed per loop: 0.0000k bytes > > 104 39852 22024 > > Average memory consumed per loop: 0.6600k bytes > > 105 39876 22024 > > Average memory consumed per loop: 0.6600k bytes > > 106 39908 22024 > > Average memory consumed per loop: 0.6600k bytes > > 107 39932 22024 > > Average memory consumed per loop: 0.6600k bytes > > 108 39960 22024 > > Average memory consumed per loop: 0.6600k bytes > > 109 39980 22057 > > Average memory consumed per loop: 1.3200k bytes > > 110 40008 22057 > > Average memory consumed per loop: 1.3200k bytes > > 111 40032 22057 > > Average memory consumed per loop: 1.3200k bytes > > 112 40056 22057 > > Average memory consumed per loop: 1.3200k bytes > > 113 40084 22057 > > Average memory consumed per loop: 1.3200k bytes > > 114 40104 22090 > > Average memory consumed per loop: 1.9800k bytes > > 115 40132 22090 > > Average memory consumed per loop: 1.9800k bytes > > 116 40156 22090 > > Average memory consumed per loop: 1.9800k bytes > > 117 40180 22090 > > Average memory consumed per loop: 1.9800k bytes > > 118 40208 22090 > > Average memory consumed per loop: 1.9800k bytes > > 119 40232 22123 > > Average memory consumed per loop: 2.6400k bytes > > 120 40256 22123 > > Average memory consumed per loop: 2.6400k bytes > > 121 40280 22123 > > Average memory consumed per loop: 2.6400k bytes > > 122 40304 22123 > > Average memory consumed per loop: 2.6400k bytes > > 123 40328 22123 > > Average memory consumed per loop: 2.6400k bytes > > 124 40356 22123 > > Average memory consumed per loop: 2.6400k bytes > > 125 40380 22156 > > Average memory consumed per loop: 3.3000k bytes > > 126 40404 22156 > > Average memory consumed per loop: 3.3000k bytes > > 127 40428 22156 > > Average memory consumed per loop: 3.3000k bytes > > 128 40452 22156 > > Average memory consumed per loop: 3.3000k bytes > > 129 40476 22156 > > Average memory consumed per loop: 3.3000k bytes > > 130 40500 22189 > > Average memory consumed per loop: 3.9600k bytes > > 131 40528 22189 > > Average memory consumed per loop: 3.9600k bytes > > 132 40548 22189 > > Average memory consumed per loop: 3.9600k bytes > > 133 40576 22189 > > Average memory consumed per loop: 3.9600k bytes > > 134 40596 22189 > > Average memory consumed per loop: 3.9600k bytes > > 135 40624 22222 > > Average memory consumed per loop: 4.6200k bytes > > 136 40652 22222 > > Average memory consumed per loop: 4.6200k bytes > > 137 40676 22222 > > Average memory consumed per loop: 4.6200k bytes > > 138 40700 22222 > > Average memory consumed per loop: 4.6200k bytes > > 139 40724 22222 > > Average memory consumed per loop: 4.6200k bytes > > 140 40744 22222 > > Average memory consumed per loop: 4.6200k bytes > > 141 40768 22255 > > Average memory consumed per loop: 5.2800k bytes > > 142 40800 22255 > > Average memory consumed per loop: 5.2800k bytes > > 143 40824 22255 > > Average memory consumed per loop: 5.2800k bytes > > 144 40848 22255 > > Average memory consumed per loop: 5.2800k bytes > > 145 40872 22255 > > Average memory consumed per loop: 5.2800k bytes > > 146 40896 22288 > > Average memory consumed per loop: 5.9400k bytes > > 147 40916 22288 > > Average memory consumed per loop: 5.9400k bytes > > 148 40940 22288 > > Average memory consumed per loop: 5.9400k bytes > > 149 40972 22288 > > Average memory consumed per loop: 5.9400k bytes > > > > > > as you can see, the memory consumption is increasing each loop, and > > furthermore, and an increasing rate :-( > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
Sebastian, I am trying to move things in the direction of simpler and cleaner namespaces, but I think that to do it well requires a systematic approach to the continuing numpification of mpl, so I have been working on mlab.py before tackling pylab. I hope everything can be done via reorganization, without requiring any import tricks, but that remains to be seen. I'm sorry this is taking a long time, but it is in the works. Eric Sebastian Haase wrote: > Hi all, > Here a quick update: > I'm trying to have a concise / sparse module with containing only > pylab-specific names and not all names I already have in numpy. > To easy typing I want to call numpy "N" and my pylab "P". > > I'm now using this code: > <code snipplet for importing matplotlib> > import matplotlib, new > matplotlib.use('WXAgg') > from matplotlib import pylab > P = new.module("pylab_sparse","""pylab module minus stuff alreay > in numpy""") > for k,v in pylab.__dict__.iteritems(): > try: > if v is N.__dict__[k]: > continue > except KeyError: > pass > P.__dict__[k] = v > > P.ion() > del matplotlib, new, pylab > </code sniplet for importing matplotlib> > > The result is "some" reduction in the number of non-pylab-specific > names in my "P"-module. However there seem to be still many extra > names left, like e.g.: > alltrue, amax, array, ... > look at this: > # 20070802 > # >>> len(dir(pylab)) > # 441 > # >>> len(dir(P)) > # 346 > # >>> P.nx.numpy.__version__ > # '1.0.1' > # >>> N.__version__ > # '1.0.1' > # >>> N.alltrue > # <function alltrue at 0x01471B70> > # >>> P.alltrue > # <function alltrue at 0x019142F0> > # >>> N.alltrue.__doc__ > # 'Perform a logical_and over the given axis.' > # >>> P.alltrue.__doc__ > # >>> #N.alltrue(x, axis=None, out=None) > # >>> #P.alltrue(x, axis=0) > > I'm using matplotlib with > __version__ = '0.90.0' > __revision__ = '$Revision: 3003 $' > __date__ = '$Date: 2007年02月06日 22:24:06 -0500 (2007年2月06日) $' > > > Any hint how to further reduce the number of names in "P" ? > My ideal would be that the "P" module (short for pylab) would only > contain the stuff described in the __doc__ strings of `pylab.py` and > `__init__.py`(in matplotlib) (+ plus some extra, undocumented, yet > pylab specific things) > > Thanks > -Sebastian > > > On 3/16/07, Eric Firing <ef...@ha...> wrote: >> Sebastian Haase wrote: >>> Hi! >>> I use the wxPython PyShell. >>> I like especially the feature that when typing a module and then the >>> dot "." I get a popup list of all available functions (names) inside >>> that module. >>> >>> Secondly, I think it really makes code clearer when one can see where >>> a function comes from. >>> >>> I have a default >>> import numpy as N >>> executed before my shell even starts. >>> In fact I have a bunch of my "standard" modules imported as <some >>> single capital letter>. >>> >>> This - I think - is a good compromise to the commonly used "extra >>> typing" and "unreadable" argument. >>> >>> a = sin(b) * arange(10,50, .1) * cos(d) >>> vs. >>> a = N.sin(b) * N.arange(10,50, .1) * N.cos(d) >> I generally do the latter, but really, all those "N." bits are still >> visual noise when it comes to reading the code--that is, seeing the >> algorithm rather than where the functions come from. I don't think >> there is anything wrong with explicitly importing commonly-used names, >> especially things like sin and cos. >> >>> I would like to hear some comments by others. >>> >>> >>> On a different note: I just started using pylab, so I did added an >>> automatic "from matplotlib import pylab as P" -- but now P contains >>> everything that I already have in N. It makes it really hard to >>> *find* (as in *see* n the popup-list) the pylab-only functions. -- >>> what can I do about this ? >> A quick and dirty solution would be to comment out most of the imports >> in pylab.py; they are not needed for the pylab functions and are there >> only to give people lots of functionality in a single namespace. >> >> I am cross-posting this to matplotlib-users because it involves mpl, and >> an alternative solution would be for us to add an rcParam entry to allow >> one to turn off all of the namespace consolidation. A danger is that if >> someone is using "from pylab import *" in a script, then whether it >> would run would depend on the matplotlibrc file. To get around that, >> another possibility would be to break pylab.py into two parts, with >> pylab.py continuing to do the namespace consolidation and importing the >> second part, which would contain the actual pylab functions. Then if >> you don't want the namespace consolidation, you could simply import the >> second part instead of pylab. There may be devils in the details, but >> it seems to me that this last alternative--splitting pylab.py--might >> make a number of people happier while having no adverse effects on >> everyone else. >> >> Eric >>> >>> Thanks, >>> Sebastian > _______________________________________________ > Numpy-discussion mailing list > Num...@sc... > http://projects.scipy.org/mailman/listinfo/numpy-discussion
There have been a number of memory leaks resolved since the 0.90.1 release. However, there are still known memory leaks in all of the GUI backends, some of which are unfortunately just beyond easy reach of matplotlib. If this is an automated process and you only care about the file output, you could try using the "Agg", "Pdf", "Ps" or "Svg" backends, e.g.: import matplotlib matplotlib.use("Agg") I tried your script with both 0.90.1 and the latest svn, and I could reproduce your leak with the TkAgg backend, but not with the Agg backend. If you need a GUI, you may want to try using the latest svn version if you can. The leaks still exist there, but they are much smaller. BTW -- you can get the version of matplotlib with: >>> import matplotlib >>> matplotlib.__version__ '0.90.1' Cheers, Mike Luke Robison wrote: > I'm writing a program that processes ~ 25,000 jobs and each iteration > draws a histogram and writes out some of the output. I let it run all > night and when I came back, python was filling up all my memory > (2Gigs) and was thrashing on and off of swap. I narrowed the problem > down to my calling of the hist() function, and was able to reproduce > it in the following code I copied from the mpl website. > > Am I not properly closing the figure somehow? > Has this issue already been addressed? > > I recently installed version 0.90.1 of matplotlib, although I don't > see any easy way to verify that version number from within python. > > -Luke Robison > > > Code: > ------------------- > import os,time,sys > from pylab import * > > def report_memory(i): > pid = os.getpid() > a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines() > print i, ' ', a2[1], > return int(a2[1].split()[1]) > > # take a memory snapshot on indStart and compare it with indEnd > indStart, indEnd = 100, 150 > for i in range(indStart,indEnd): > ind = arange(100) > xx = rand(len(ind)) > > figure(1) > hist(xx) > close(1) > > # wait a few cycles for memory usage to stabilize > if i==indStart: start = val > if i>indStart: > end = val > print 'Average memory consumed per loop: %1.4fk bytes' % \ > ((end-start)/float(indEnd-indStart)) > > ----------------- > > Output: > > > python memtest.py > > Average memory consumed per loop: 0.0000k bytes > 102 39808 21991 > Average memory consumed per loop: 0.0000k bytes > 103 39828 21991 > Average memory consumed per loop: 0.0000k bytes > 104 39852 22024 > Average memory consumed per loop: 0.6600k bytes > 105 39876 22024 > Average memory consumed per loop: 0.6600k bytes > 106 39908 22024 > Average memory consumed per loop: 0.6600k bytes > 107 39932 22024 > Average memory consumed per loop: 0.6600k bytes > 108 39960 22024 > Average memory consumed per loop: 0.6600k bytes > 109 39980 22057 > Average memory consumed per loop: 1.3200k bytes > 110 40008 22057 > Average memory consumed per loop: 1.3200k bytes > 111 40032 22057 > Average memory consumed per loop: 1.3200k bytes > 112 40056 22057 > Average memory consumed per loop: 1.3200k bytes > 113 40084 22057 > Average memory consumed per loop: 1.3200k bytes > 114 40104 22090 > Average memory consumed per loop: 1.9800k bytes > 115 40132 22090 > Average memory consumed per loop: 1.9800k bytes > 116 40156 22090 > Average memory consumed per loop: 1.9800k bytes > 117 40180 22090 > Average memory consumed per loop: 1.9800k bytes > 118 40208 22090 > Average memory consumed per loop: 1.9800k bytes > 119 40232 22123 > Average memory consumed per loop: 2.6400k bytes > 120 40256 22123 > Average memory consumed per loop: 2.6400k bytes > 121 40280 22123 > Average memory consumed per loop: 2.6400k bytes > 122 40304 22123 > Average memory consumed per loop: 2.6400k bytes > 123 40328 22123 > Average memory consumed per loop: 2.6400k bytes > 124 40356 22123 > Average memory consumed per loop: 2.6400k bytes > 125 40380 22156 > Average memory consumed per loop: 3.3000k bytes > 126 40404 22156 > Average memory consumed per loop: 3.3000k bytes > 127 40428 22156 > Average memory consumed per loop: 3.3000k bytes > 128 40452 22156 > Average memory consumed per loop: 3.3000k bytes > 129 40476 22156 > Average memory consumed per loop: 3.3000k bytes > 130 40500 22189 > Average memory consumed per loop: 3.9600k bytes > 131 40528 22189 > Average memory consumed per loop: 3.9600k bytes > 132 40548 22189 > Average memory consumed per loop: 3.9600k bytes > 133 40576 22189 > Average memory consumed per loop: 3.9600k bytes > 134 40596 22189 > Average memory consumed per loop: 3.9600k bytes > 135 40624 22222 > Average memory consumed per loop: 4.6200k bytes > 136 40652 22222 > Average memory consumed per loop: 4.6200k bytes > 137 40676 22222 > Average memory consumed per loop: 4.6200k bytes > 138 40700 22222 > Average memory consumed per loop: 4.6200k bytes > 139 40724 22222 > Average memory consumed per loop: 4.6200k bytes > 140 40744 22222 > Average memory consumed per loop: 4.6200k bytes > 141 40768 22255 > Average memory consumed per loop: 5.2800k bytes > 142 40800 22255 > Average memory consumed per loop: 5.2800k bytes > 143 40824 22255 > Average memory consumed per loop: 5.2800k bytes > 144 40848 22255 > Average memory consumed per loop: 5.2800k bytes > 145 40872 22255 > Average memory consumed per loop: 5.2800k bytes > 146 40896 22288 > Average memory consumed per loop: 5.9400k bytes > 147 40916 22288 > Average memory consumed per loop: 5.9400k bytes > 148 40940 22288 > Average memory consumed per loop: 5.9400k bytes > 149 40972 22288 > Average memory consumed per loop: 5.9400k bytes > > > as you can see, the memory consumption is increasing each loop, and > furthermore, and an increasing rate :-( > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
I'm writing a program that processes ~ 25,000 jobs and each iteration draws a histogram and writes out some of the output. I let it run all night and when I came back, python was filling up all my memory (2Gigs) and was thrashing on and off of swap. I narrowed the problem down to my calling of the hist() function, and was able to reproduce it in the following code I copied from the mpl website. Am I not properly closing the figure somehow? Has this issue already been addressed? I recently installed version 0.90.1 of matplotlib, although I don't see any easy way to verify that version number from within python. -Luke Robison Code: ------------------- import os,time,sys from pylab import * def report_memory(i): pid = os.getpid() a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines() print i, ' ', a2[1], return int(a2[1].split()[1]) # take a memory snapshot on indStart and compare it with indEnd indStart, indEnd = 100, 150 for i in range(indStart,indEnd): ind = arange(100) xx = rand(len(ind)) figure(1) hist(xx) close(1) # wait a few cycles for memory usage to stabilize if i==indStart: start = val if i>indStart: end = val print 'Average memory consumed per loop: %1.4fk bytes' % \ ((end-start)/float(indEnd-indStart)) ----------------- Output: python memtest.py Average memory consumed per loop: 0.0000k bytes 102 39808 21991 Average memory consumed per loop: 0.0000k bytes 103 39828 21991 Average memory consumed per loop: 0.0000k bytes 104 39852 22024 Average memory consumed per loop: 0.6600k bytes 105 39876 22024 Average memory consumed per loop: 0.6600k bytes 106 39908 22024 Average memory consumed per loop: 0.6600k bytes 107 39932 22024 Average memory consumed per loop: 0.6600k bytes 108 39960 22024 Average memory consumed per loop: 0.6600k bytes 109 39980 22057 Average memory consumed per loop: 1.3200k bytes 110 40008 22057 Average memory consumed per loop: 1.3200k bytes 111 40032 22057 Average memory consumed per loop: 1.3200k bytes 112 40056 22057 Average memory consumed per loop: 1.3200k bytes 113 40084 22057 Average memory consumed per loop: 1.3200k bytes 114 40104 22090 Average memory consumed per loop: 1.9800k bytes 115 40132 22090 Average memory consumed per loop: 1.9800k bytes 116 40156 22090 Average memory consumed per loop: 1.9800k bytes 117 40180 22090 Average memory consumed per loop: 1.9800k bytes 118 40208 22090 Average memory consumed per loop: 1.9800k bytes 119 40232 22123 Average memory consumed per loop: 2.6400k bytes 120 40256 22123 Average memory consumed per loop: 2.6400k bytes 121 40280 22123 Average memory consumed per loop: 2.6400k bytes 122 40304 22123 Average memory consumed per loop: 2.6400k bytes 123 40328 22123 Average memory consumed per loop: 2.6400k bytes 124 40356 22123 Average memory consumed per loop: 2.6400k bytes 125 40380 22156 Average memory consumed per loop: 3.3000k bytes 126 40404 22156 Average memory consumed per loop: 3.3000k bytes 127 40428 22156 Average memory consumed per loop: 3.3000k bytes 128 40452 22156 Average memory consumed per loop: 3.3000k bytes 129 40476 22156 Average memory consumed per loop: 3.3000k bytes 130 40500 22189 Average memory consumed per loop: 3.9600k bytes 131 40528 22189 Average memory consumed per loop: 3.9600k bytes 132 40548 22189 Average memory consumed per loop: 3.9600k bytes 133 40576 22189 Average memory consumed per loop: 3.9600k bytes 134 40596 22189 Average memory consumed per loop: 3.9600k bytes 135 40624 22222 Average memory consumed per loop: 4.6200k bytes 136 40652 22222 Average memory consumed per loop: 4.6200k bytes 137 40676 22222 Average memory consumed per loop: 4.6200k bytes 138 40700 22222 Average memory consumed per loop: 4.6200k bytes 139 40724 22222 Average memory consumed per loop: 4.6200k bytes 140 40744 22222 Average memory consumed per loop: 4.6200k bytes 141 40768 22255 Average memory consumed per loop: 5.2800k bytes 142 40800 22255 Average memory consumed per loop: 5.2800k bytes 143 40824 22255 Average memory consumed per loop: 5.2800k bytes 144 40848 22255 Average memory consumed per loop: 5.2800k bytes 145 40872 22255 Average memory consumed per loop: 5.2800k bytes 146 40896 22288 Average memory consumed per loop: 5.9400k bytes 147 40916 22288 Average memory consumed per loop: 5.9400k bytes 148 40940 22288 Average memory consumed per loop: 5.9400k bytes 149 40972 22288 Average memory consumed per loop: 5.9400k bytes as you can see, the memory consumption is increasing each loop, and furthermore, and an increasing rate :-(
Hi, I've created a plot with the correct scale but I want to add more room at the bottom of the plot to add a title block with out effecting the size of the plot. Does anyone know how to do this? Regards, Jonathan School of Mechanical and Aerospace Engineering Ashby Building Stranmillis Road Belfast BT9 5AH Tel: +44 (0)28 9097 4277 Fax: +44 (0)28 9066 1729 Email: <mailto:jma...@qu...> jma...@qu...