Re: Building classpath with ecj

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23/03/2008, Audrius Meskauskas <audriusa@xxxxxxxxxx> wrote:
> Trevor Harmon wrote:
>  > My understanding is that the latest release of classpath can be built
>  > using ecj. This is not working for me, however. My configure settings
>  > are:
>  >
>  > --disable-dependency-tracking --disable-gtk-peer --disable-gconf-peer
>  > --disable-plugin --enable-jni --with-ecj-jar=<path to ecj.jar>
>  > --with-vm=java
>  >
>  > But I get an error during build:
>  >
>  > $ make
>  > Making all in lib
>  > true
>  > top_builddir=.. top_srcdir=.. /bin/sh ./gen-classlist.sh standard
>  > Adding java source files from srcdir '..'.
>  > Adding java source files from VM directory ../vm/reference
>  > ecj -warn:-deprecation,serial,unusedImport  -J-Xmx768M -source 1.5
>  > -target 1.5 -bootclasspath '' -classpath
>  > ../vm/reference:..:../external/w3c_dom:../external/sax:../external/relaxngDatatype:../external/jsr166:.::
>  > -d . @classes
>  > incorrect classpath:
>  > Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
>  >     at
>  > java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:44)
>  >     at java.lang.StringBuffer.<init>(StringBuffer.java:80)
>  >     at java.io.StringWriter.<init>(StringWriter.java:33)
>  >     at
>  > org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:475)
>  >
>  >     at
>  > org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:430)
>  >     at
>  > org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:2697)
>  >
>  >     at
>  > org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1272)
>  >     at org.eclipse.jdt.internal.compiler.batch.Main.main(Main.java:1016)
>  > make[1]: *** [compile-classes] Error 1
>  > make: *** [all-recursive] Error 1
>  >
>  > This is with classpath 0.97.1, ecj 3.2.2, and Java 1.5.0_13 on Mac OS
>  > X 10.5.2.
>  >
>  > I tried changing the memory option from "-J-Xmx768M" to "-J-Xmx2048M"
>  > but I still got the same error. Surely 2GB is a large enough ceiling
>  > for the build. And my machine has 4GB RAM, so I don't know why I'm
>  > running out of heap space. Any suggestions? Thanks,
>  >
>  > Trevor
>  >
>  >
>  >
>
> This problem is frequent when ecj is used together with CACAO or Sun's
>  virtual machines that have the memory limit set. From the listing, your
>  system seems configured to use the Sun's 1.5 jre to run the ecj
>  compiler. This problem never occurs with default setup that uses gij,
>  because gij has no such memory limitations but I am not sure if gij is
>  available under Mac OS.
>
>  The ecj startup script does not respect the -J-X options. Check where is
>  the script is with 'which ecj', then look into contents of that file. It
>  is a text file in .sh format. The most straightforward way is to correct
>  it manually, adding -J-Xmx768M at the place where the script invokes
>  java virtual machine.
>
>  Good luck
>
> Audrius
>
>
>
>
>

As Audrius says, the problem here is ecj (and also the wrapper used to
run it) ignoring the -J option passed to it by the Classpath build.
You need to alter the script that runs ecj to include this option
instead.

It really would be preferable if distributors could include support
for this option when writing wrapper scripts for ecj that don't use
gij (which has a 'memory limit' of 2^64 IIRC ;) )
-- 
Andrew :-)

Document Freedom Day - March 26th
http://documentfreedom.org

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8


[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux