memory limit for maxima

411 views
Skip to first unread message

Jean-Marc Schlenker

unread,
Nov 13, 2009, 11:26:51 AM11/13/09
to sage-support
Hello, I'm trying to do a slightly heavy computation under sage
(symbolic computation of a 9x9 determinant with some polynomials in
cos/sin as entries) but sage crashes with the message:

"Maxima encountered a Lisp error:
Memory limit reached. Please jump to an outer point or quit program."

I'm pretty sure that sage does not use all the memory on my computer
so it should be possible to increase the memory limit of maxima. Does
anybody has an idea how to do this?
Thanks in advance!

Message has been deleted

Robert Dodier

unread,
Nov 13, 2009, 3:47:58 PM11/13/09
to sage-support
On Nov 13, 9:26 am, Jean-Marc Schlenker <jmschlen...@gmail.com> wrote:

> Hello, I'm trying to do a slightly heavy computation under sage
> (symbolic computation of a 9x9 determinant with some polynomials in
> cos/sin as entries) but sage crashes with the message:
>
> "Maxima encountered a Lisp error:
>  Memory limit reached. Please jump to an outer point or quit program."

Aside from allocating more memory, here are a couple of things to
consider.

(1) try to gauge the time required to find the determinant.
How does the time required increase for 2 x 2, 3 x 3, 4 x 4, etc?
For symbolic calculations, time & memory can increase
much faster than one might expect.

(2) Maxima may be able to apply different algorithms to
compute determinants, I don't remember for sure.
You might ask on the mailing list (max...@math.utexas.edu).

Sorry I can't be more helpful.

Robert Dodier

Marshall Hampton

unread,
Nov 13, 2009, 3:56:15 PM11/13/09
to sage-support
If there is any structure to your matrix that would let you pre-
simplify it a bit before taking the determinant it would probably help
a lot. Another possibility is to rename sines and cosines as
polynomial variables (i.e. let s1 = sin(x1), c1 = cos(x1), etc) and
have the entries belong to a PolynomialRing. Then the arithmetic will
use Singular instead of Maxima, and usually I find that approach can
handle larger problems.

-M. Hampton

On Nov 13, 10:26 am, Jean-Marc Schlenker <jmschlen...@gmail.com>
wrote:

Jean-Marc Schlenker

unread,
Nov 16, 2009, 9:40:41 AM11/16/09
to sage-support
Thanks a lot for all 3 answers!
It turned out (as is often the case I guess) that adding a small
amount of mathematical intelligence
in the problem decreased the computational difficulty a great deal and
made it tractable.
Still I find it strange that it's not easier to increase the amount of
memory that maxima can use,
but I'm just a stupid mathematician using sage as a tool, and I don't
understand anything about
the way it works.

William Stein

unread,
Nov 16, 2009, 11:28:19 AM11/16/09
to sage-s...@googlegroups.com, Juan Jose Garcia-Ripoll, Robert Dodier
On Mon, Nov 16, 2009 at 6:40 AM, Jean-Marc Schlenker
<jmsch...@gmail.com> wrote:
>
> Thanks a lot for all 3 answers!
> It turned out (as is often the case I guess) that adding a small
> amount of mathematical intelligence
> in the problem decreased the computational difficulty a great deal and
> made it tractable.
> Still I find it strange that it's not easier to increase the amount of
> memory that maxima can use,

It is "easy". Just do the following (all as one line):

maxima._eval_line(":lisp (ext:set-limit 'ext:heap-size 100000000000)",
wait_for_prompt=False)

That makes it so Maxima can use up to 100GB (?). If you try this and
it works, please report back -- we could easily make it the default.
It seems this is just an upper bound: I just tried it on my 2GB laptop
and it works fine.

See trac 6772: http://trac.sagemath.org/sage_trac/ticket/6772

I've posted a little easy-to-review patch there that fixes this issue
once-for-all, which needs review.

William

Reply all
Reply to author
Forward
0 new messages