Java puts code (as opposed to data) in PermGen space (i.e. space that doesn't get garbage collected). The size of this space is fixed by default but can be overridden with a command line argument. Maxima (along with the Java code) probably contains too much code for the default java configuration. You can increase this java default as follows:<div>
<br></div><div><br></div><div> java <span class="Apple-style-span" style="color:rgb(68,71,72);font-family:'Lucida Grande',Verdana,Arial,sans-serif;font-size:12px;line-height:16px">-XX:MaxPermSize=200M </span> -jar /path/to/abcl.jar</div>
<div><br></div><div>This makes the max permgen space 200 MB. You may have to vary that number.</div><div><br></div><div>Blake McBride</div><div><br></div><div><br><br><div class="gmail_quote">On Tue, Jun 19, 2012 at 6:29 AM, Phuc Luoi <span dir="ltr"><<a href="mailto:phucluoi@gmail.com" target="_blank">phucluoi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---------- Forwarded message ----------<br>
From: Phuc Luoi <<a href="mailto:phucluoi@gmail.com">phucluoi@gmail.com</a>><br>
Date: Tue, Jun 19, 2012 at 12:51 PM<br>
Subject: Re: [armedbear-devel] How to compile and run Maxima with ABCL?<br>
To: Robert Dodier <<a href="mailto:robert.dodier@gmail.com">robert.dodier@gmail.com</a>><br>
<br>
<br>
Thanks for your answer.<br>
<br>
I tried this and got these errors:<br>
<br>
Can't intern zero-length symbol.<br>
Restarts:<br>
0: RETRY Retry compiling #<ASDF:CL-SOURCE-FILE "maxima"<br>
"utilities" "mformt">.<br>
1: ACCEPT Continue, treating compiling #<ASDF:CL-SOURCE-FILE<br>
"maxima" "utilities" "mformt"> as having been successful.<br>
2: TOP-LEVEL Return to top level.<br>
<br>
by compiling the file<br>
/maxima-5.27.0/src/mformt.lisp (step 9)<br>
<br>
I have choose the option 1 to accept this. I got some more errors by<br>
compiling. After all I got<br>
<br>
Out of memory PermGen space<br>
Restarts:<br>
0: TOP-LEVEL Return to top level.<br>
<br>
and abcl did not compiled maxima.<br>
<br>
Can you tell me why I got these error? And how can repair them?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Tue, Jun 19, 2012 at 5:04 AM, Robert Dodier <<a href="mailto:robert.dodier@gmail.com">robert.dodier@gmail.com</a>> wrote:<br>
> On 2012-06-16, Phuc Luoi <<a href="mailto:phucluoi@gmail.com">phucluoi@gmail.com</a>> wrote:<br>
><br>
>> How can I compile and run Maxima with ABCL?<br>
><br>
> (1) Unpack a Maxima tarball.<br>
> <a href="http://sourceforge.net/projects/maxima" target="_blank">http://sourceforge.net/projects/maxima</a> and follow links to download page.<br>
> Look for "Maxima-source".<br>
><br>
> (2) cd /path/to/maxima-5.27.0<br>
><br>
> (3) java -jar /path/to/abcl.jar<br>
><br>
> (4) (configure) ;; you can probably accept defaults for most/all questions<br>
><br>
> (5) (quit)<br>
><br>
> (6) cd src<br>
><br>
> (7) java -jar /path/to/abcl.jar<br>
><br>
> (8) (require 'asdf)<br>
><br>
> (9) (asdf:operate 'asdf:load-op :maxima)<br>
><br>
> (10) (quit)<br>
><br>
> (11) java -jar /path/to/abcl.jar<br>
><br>
> (12) (require 'asdf)<br>
><br>
> (13) (asdf:operate 'asdf:load-op :maxima) ;; yes, same as (9)<br>
><br>
> (14) (cl-user::run) ;; should bring up Maxima banner & input prompt<br>
><br>
><br>
>> Furthermore can I emmbed maxima in a Java Programm with ABCL?<br>
><br>
> Yes. I've appended an example program. Command line to compile it:<br>
><br>
> javac -cp /path/to/abcl.jar -d /path/to/compiled/class abcl_maxima.java<br>
><br>
> To execute it: (you must be in the Maxima src directory)<br>
><br>
> java -cp /path/to/compiled/class:/path/to/abcl.jar abcl_maxima<br>
><br>
> I get: (takes a minute or two to load Maxima)<br>
><br>
> loading Maxima ... finished.<br>
> x.getClass => class org.armedbear.lisp.Cons<br>
> x = org.armedbear.lisp.Cons@1748ba8<br>
> x.javaInstance => org.armedbear.lisp.Cons@1748ba8<br>
> x.javaInstance.getClass => class org.armedbear.lisp.Cons<br>
> 4 factors of 12341234<br>
> factor: 2, multiplicity: 1<br>
> factor: 73, multiplicity: 1<br>
> factor: 137, multiplicity: 1<br>
> factor: 617, multiplicity: 1<br>
><br>
><br>
> Note that all user functions have names which begin with dollar sign.<br>
> E.g. user function ifactors <==> $IFACTORS in Lisp<br>
><br>
> If you need help with Lisp programming for Maxima, ask questions on the<br>
> mailing list. See: <a href="http://maxima.sourceforge.net/maximalist.html" target="_blank">http://maxima.sourceforge.net/maximalist.html</a><br>
><br>
> Hope this helps, have fun, & good luck.<br>
><br>
> Robert Dodier<br>
><br>
> PS. Example program abcl_maxima.java:<br>
><br>
> // abcl_maxima.java -- example program for calling Maxima from Java via ABCL<br>
> // copyright 2012 by Robert Dodier<br>
> // I release this work under terms of the GNU General Public License<br>
><br>
> import org.armedbear.lisp.Interpreter;<br>
> import org.armedbear.lisp.Package;<br>
> import org.armedbear.lisp.Packages;<br>
> import org.armedbear.lisp.Symbol;<br>
> import org.armedbear.lisp.Function;<br>
> import org.armedbear.lisp.LispObject;<br>
> import org.armedbear.lisp.Fixnum;<br>
> import org.armedbear.lisp.Bignum;<br>
> import org.armedbear.lisp.Cons;<br>
><br>
> public class abcl_maxima<br>
> {<br>
> public static void main (String [] args) throws Exception<br>
> {<br>
> int a;<br>
><br>
> if (args.length > 0)<br>
> a = Integer.parseInt (args [0]);<br>
> else<br>
> a = 12341234;<br>
><br>
> Interpreter I = Interpreter.createInstance ();<br>
> System.out.print ("loading Maxima ... ");<br>
> I.eval ("(require 'asdf)");<br>
> I.eval ("(asdf:operate 'asdf:load-op :maxima)");<br>
> System.out.println ("finished.");<br>
> Package P = Packages.findPackage ("MAXIMA");<br>
><br>
> // java.util.List <Symbol> L = P.getAccessibleSymbols ();<br>
> // for (Symbol S : L)<br>
> // {<br>
> // if (P.equals (S.getPackage ()))<br>
> // System.out.println (S.toString ());<br>
> // }<br>
><br>
> Symbol S = P.findAccessibleSymbol ("$IFACTORS");<br>
> Function F = (Function) S.getSymbolFunction ();<br>
> LispObject x = Bignum.getInstance (a);<br>
> x = F.execute (x);<br>
> System.out.println ("x.getClass => " + x.getClass ());<br>
> System.out.println ("x = " + x);<br>
> System.out.println ("x.javaInstance => " + x.javaInstance ());<br>
> System.out.println ("x.javaInstance.getClass => " + x.javaInstance () . getClass ());<br>
><br>
> int n = ((Cons) x).length ();<br>
> System.out.println ((n - 1) + " factors of " + a);<br>
><br>
> for (int i = 1; i < n; i++)<br>
> {<br>
> Cons x1 = (Cons) ((Cons) x).NTH (i);<br>
> Fixnum f = (Fixnum) x1.NTH (1);<br>
> Fixnum m = (Fixnum) x1.NTH (2);<br>
> System.out.println ("factor: " + f.intValue () + ", multiplicity: " + m.intValue ());<br>
> }<br>
> }<br>
> }<br>
><br>
><br>
> _______________________________________________<br>
> armedbear-devel mailing list<br>
> <a href="mailto:armedbear-devel@common-lisp.net">armedbear-devel@common-lisp.net</a><br>
> <a href="http://lists.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel" target="_blank">http://lists.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel</a><br>
<br>
_______________________________________________<br>
armedbear-devel mailing list<br>
<a href="mailto:armedbear-devel@common-lisp.net">armedbear-devel@common-lisp.net</a><br>
<a href="http://lists.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel" target="_blank">http://lists.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel</a><br>
</div></div></blockquote></div><br></div>