Hi Golam, On Mon, Jul 27, 2009 at 12:01 PM, Golam Mortuza Hossain<gmhoss...@gmail.com> wrote: > > Hi, > > While doing some symbolic computations that require > Maxima interface, "timeit" reports progressively > longer duration for the same computation. > > --------- > sage: f(x) = function('f',x); > sage: timeit('bool( f(x) == 0 )') > 5 loops, best of 3: 71.6 ms per loop > sage: timeit('bool( f(x) == 0 )') > 5 loops, best of 3: 89.1 ms per loop > sage: timeit('bool( f(x) == 0 )') > 5 loops, best of 3: 101 ms per loop > sage: timeit('bool( f(x) == 0 )') > 5 loops, best of 3: 127 ms per loop > sage: timeit('bool( f(x) == 0 )') > 5 loops, best of 3: 159 ms per loop > sage: timeit('bool( f(x) == 0 )') > 5 loops, best of 3: 231 ms per loop > sage: timeit('bool( f(x) == 0 )') > 5 loops, best of 3: 305 ms per loop > ----------- > > Is something leaking in the maxima interface?
There is definitely memory leak. Here is the output of a valgrind session: [mv...@sage ~]$ sage -valgrind --leak-check=full --show-reachable=yes ---------------------------------------------------------------------- | Sage Version 4.1, Release Date: 2009-07-09 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- /usr/local/sage/local/bin/sage-ipython Log file is /home/mvngu/.sage/valgrind/sage-memcheck.%p Using default flags: --leak-resolution=high --log-file=/home/mvngu/.sage/valgrind/sage-memcheck.%p --leak-check=full --num-callers=25 --suppressions=/usr/local/sage/local/lib/valgrind/sage.supp Python 2.6.2 (r262:71600, Jul 10 2009, 10:49:45) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. sage: f(x) = function('f',x) sage: timeit('bool( f(x) == 0 )') 5 loops, best of 3: 779 ms per loop sage: timeit('bool( f(x) == 0 )') 5 loops, best of 3: 676 ms per loop sage: timeit('bool( f(x) == 0 )') 5 loops, best of 3: 837 ms per loop sage: timeit('bool( f(x) == 0 )') 5 loops, best of 3: 791 ms per loop sage: timeit('bool( f(x) == 0 )') 5 loops, best of 3: 755 ms per loop sage: timeit('bool( f(x) == 0 )') 5 loops, best of 3: 860 ms per loop sage: timeit('bool( f(x) == 0 )') 5 loops, best of 3: 815 ms per loop Here's a leak summary: ==11471== LEAK SUMMARY: ==11471== definitely lost: 8 bytes in 1 blocks. ==11471== possibly lost: 473,247 bytes in 1,119 blocks. ==11471== still reachable: 48,988,835 bytes in 32,885 blocks. ==11471== suppressed: 0 bytes in 0 blocks. -- Regards Minh Van Nguyen --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---