jc1 out of memory error gcc 4.2.2 Linux 64-bit OS

2008-01-13 Thread Harpal Grover
Hello all,

I downloaded and built gcc 4.2.2 on my linux box. I have also used the
sources to build a cross compiler using Ranjit's Matthews guide.  The
build went just fine. I tried to compile my java application and got
the following error:

c1: out of memory allocating 4064 bytes after a total of 3909824512 bytes

The specs on my laptop are as follows:
Intel Core 2 Duo
Suse 10.2 64-bit
Linux 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 2006 x86_64
x86_64 x86_64 GNU/Linux
4 GB Ram

jc1 spiked from 1 gig of memory to close to 4gb, eats up the swap and
then finally crashes. Is there any additional information you guys
would like me to provide? If so please feel free to let me know and I
gladly will.

Thanks in advance!

-- 
Harpal Grover
President
Harpal Grover Consulting Inc


Re: jc1 out of memory error gcc 4.2.2 Linux 64-bit OS

2008-01-14 Thread Harpal Grover
On Jan 14, 2008 5:09 AM, Andrew Haley <[EMAIL PROTECTED]> wrote:
>
> Harpal Grover writes:
>  > Hello all,
>  >
>  > I downloaded and built gcc 4.2.2 on my linux box. I have also used the
>  > sources to build a cross compiler using Ranjit's Matthews guide.  The
>  > build went just fine. I tried to compile my java application and got
>  > the following error:
>  >
>  > c1: out of memory allocating 4064 bytes after a total of 3909824512 bytes
>  >
>  > The specs on my laptop are as follows:
>  > Intel Core 2 Duo
>  > Suse 10.2 64-bit
>  > Linux 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 2006 x86_64
>  > x86_64 x86_64 GNU/Linux
>  > 4 GB Ram
>  >
>  > jc1 spiked from 1 gig of memory to close to 4gb, eats up the swap and
>  > then finally crashes. Is there any additional information you guys
>  > would like me to provide? If so please feel free to let me know and I
>  > gladly will.
>
> I want to know what you were trying to compile.
>
> Andrew.

Hello

I am trying to compile a java app. I don't have the script in front of
me that i am using because I am at a client's office right now. The
jist of
the command line is as follows:

gcj -O -fjni -s -main=main.App --classpath=x1.jar x2.jar x3.jar x4.jar
x5.jar x6.jar x7.jar x8.jar -o scln.exe class1.java class2.java
class3.java ... class125.java -ly -ldz

So, this was fine compiling on Windows using a Native Cross Compiler
provided by Mohan Embar on a 32 bit processor. After upgrading my
hardware to a 64 bit processor, things were not working as pleasant as
I was hoping for. After some deliberation, I decided to build a cross
compiler on Linux using Ranjit Matthews tutorial.

Long story short, I contacted Ranjit and Marco Trudel on this matter,
and they have encouraged me to take this matter into my own hands. So
I am going to get started on debugging this issue tonight. I have been
looking for a good excuse to get involved in development for gcc for
sometime now and this is a good time.

Marco has confirmed this issue seems to be isolated to 64 bit
processors. I am new to this, so from my understanding gdb is the
debugging tool i am going to
want to use. As for IDE, what do you recommend? You must keep in mind
I am quite spoiled by such IDE's as Eclipse and Borland :P, so I
though KDevelop may be suit my needs? And any advice, or direction is
gladly welcomed.

Thanks

-- 
Harpal Grover
President
Harpal Grover Consulting Inc


Re: jc1 out of memory error gcc 4.2.2 Linux 64-bit OS

2008-01-17 Thread Harpal Grover
>  > I am trying to compile a java app. I don't have the script in front of
>  > me that i am using because I am at a client's office right now. The
>  > jist of
>  > the command line is as follows:
>  >
>  > gcj -O -fjni -s -main=main.App --classpath=x1.jar x2.jar x3.jar x4.jar
>  > x5.jar x6.jar x7.jar x8.jar -o scln.exe class1.java class2.java
>  > class3.java ... class125.java -ly -ldz
>
> This is very likely to cause out of memory errors.  This will probably
> work better:
>
> gcj -c -O -fjni --classpath=x1.jar x2.jar
> gcj -c -O -fjni --classpath=x1.jar x3.jar
> gcj -c -O -fjni --classpath=x1.jar x4.jar
>
> And link them all together at the end.


Thanks to everyone for their kind help and advice. I tried Andrew's
advice out as noted above, and it worked! I was finally able to
generate a windows executable on 64 bit processors . On another note,
I had to process all my classes as class files and not as java files
for this to work. There is one last issue, of which I have a feeling
may not be a big issue. When I double click on my executable, I get
the following stacktrace printed out to a command prompt window:

Exception in thread "main" java.lang.NoClassDefFoundError: main.App
 at java.lang.Class.initializeClass(/datal/gcc/gcc/gcc/libgcc2.c:0)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Listener no
t found in gnu.gcj.runtime.SystemClassLoader{urls=[file:.\], parent=gnu.gcj.runt
ime.ExtensionClassLoader{urls=[], parent=null}}
 at java.net.URLClassLoader.findClass(/datal/gcc/gcc/libjava/java/net/URLClass
Loader.java:1080)
 at java.lang.ClassLoader.loadClass(/datal/gcc/gcc/libjava/java/lang/ClassLoad
er.java:351)
 at java.lang.ClassLoader.loadClass(/datal/gcc/gcc/libjava/java/lang/ClassLoad
er.java:295)
 at java.lang.VMClassLoader.defineClass(/datal/gcc/gcc/libjava/classpath/java/
io/Writer.java:187)
 at java.lang.ClassLoader.defineClass(/datal/gcc/gcc/libjava/java/lang/ClassLo
ader.java:483)
 at java.security.SecureClassLoader.defineClass(/datal/gcc/gcc/libjava/classpa
th/java/security/SecureClassLoader.java:108)
 at java.net.URLClassLoader.findClass(/datal/gcc/gcc/libjava/java/net/URLClass
Loader.java:1171)
 at java.lang.ClassLoader.loadClass(/datal/gcc/gcc/libjava/java/lang/ClassLoad
er.java:351)
 at java.lang.ClassLoader.loadClass(/datal/gcc/gcc/libjava/java/lang/ClassLoad
er.java:295)
 at java.lang.Class.initializeClass(/datal/gcc/gcc/gcc/libgcc2.c:0)

It looks like it is not able to find or load the swt library i use for
my app. I have compiled, and linked the swt jar to the executable, and
the corresponding swt dll is in the same directory where my executable
is located. The following line below is used to generate my
executable:

gcj -O -fjni -findirect-dispatch "--classpath=
C:/lib/x1.jar;C:/lib/x2.jar" --main=main.App -o scnlm.exe y1.class
y2.class -LC:/projects/java/TSCN/Desktop/3232 -lswt -lswt-win32-3232

Note all of the jars have been compiled into libswt, including swt.jar

--
Harpal Grover
President
Harpal Grover Consulting Inc