Bug 79963 - Getting java.lang.OutOfMemoryError, while compilation
Summary: Getting java.lang.OutOfMemoryError, while compilation
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.1.1   Edit
Hardware: PC Windows 2000
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-02 02:38 EST by Praveen Puri CLA
Modified: 2004-12-02 10:19 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Praveen Puri CLA 2004-12-02 02:38:54 EST
I am trying to compile my project using AspectJ compiler v1.1.1. My Project has 
nearly 1000 java files. But everytime I compile, I 
get "java.lang.OutOfMemoryError". I have tries compiling my project in parts 
also, but it gives the same error, while compiling 200 files together. I can 
not afford to compile less than these files at a time, as these are in 
different packages also. Exact compiler options I am giving is....

C:\jdk1.4.2_04\bin\java -cp C:\progra~1\JBuilder9
\lib\ext\aspectjrt.jar;C:\progra~1
\JBuilder9lib\ext\aspectjtools.jar;D:\Temp\RecordsManager\lib-extract\ALL 
org.aspectj.tools.ajc.Main -g -d "D:\~Working\FileNet\RecordsManager\WEB-
INF\classes" -sourceroots "com\filenet\wcm;com\filenet\rm;com\filenet\portal" 
1>compile_log.txt 2>&1 

And exact text of error is.....
java.lang.OutOfMemoryError
D:\~Working\FileNet\RecordsManager\Source\com\filenet\wcm\apps\server\ui\WcmPlug
InModule.java:0 Internal compiler error
java.lang.OutOfMemoryError

!! no source information available !!
ABORT
Exception thrown from AspectJ 1.1.1

Please look into this asap. 

I get the same error, If I try to compile the same code from JBuilder (with 
AspectJ plugin).

Regards,
Praveen
Comment 1 Andrew Clement CLA 2004-12-02 03:36:47 EST
Two things spring to mind.

First, from the list of compiler options, you don't seem to be specifying a
large heap setting?  The default for the JVM is 64M I think, which isn't very
much at all.  Can you try by specifying '-Xmx256M' or '-Xmx512M' to supply more
memory?

Second, 1.1.1 is an old version of AspectJ - 1.2.1 is now out and improves
memory usage and compile/weave times - can you switch to this new version?

let me know what happens.
Comment 2 Praveen Puri CLA 2004-12-02 04:22:46 EST
The problem has been resolved by using '-Xmx256M' option in compiler options. 
But this option is not accepted by AspectJ plugin in Jbuilder. I guess, this is 
not the right place to discuss about that plugin. Anyway I am able to compile 
now through command prompt after increasing heap size.

Thanks,

Praveen
Comment 3 Mik Kersten CLA 2004-12-02 10:19:38 EST
For JBuilder, add the following line to your <jbuilder>/bin/jbuilder.config 
file:

vmparam -Xmx256m

Or more if you find it still running out.