• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

compiling issue

 
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello:

I got compiling error when I try to compile 648 source files in build.xml.

[javac] The system is out of resources.
[javac] Consult the following stack trace for details.

[javac] java.lang.OutOfMemoryError
[javac] <<no stack trace available>

My computer has 1GB RAM, it should not be the problem.

I compiled successfully even for 651 files before. Those 648 files are different versions from those 651 files, just many source code changes.

What could be the problem?

Thanks a lot
 
Ranch Hand
Posts: 158
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May i know which IDE you are using?

You must be known that for compiling a single class file that contents a reference from other file(s), are also compile simultaniously.

It is dependend that some IDE only complie file once at a time.

Like i have A file, B file and C file.

If C file is referenced in both A and B files. While compiling A file (If c file is not compiled before) it also compile C file and when u compile file B then that IDE doesnot recompile C file again.

So finally my point of view is that the problem could be because of it. (I THINK THIS COULD BE THE REASON FOR ERROR.)

Correct me if i am wrong......
 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

i think u should try to free some memory(not ur hard disk) out of memory error pops up when jvm can no furthur allocate memory for creating new objects.

try this
assign null to all the refrences u no longer use

Object f=new Object();
f=null

and run garbage collector by using
System.gc();

though this may or may not actually dispose of the unsed objects

hope that helps
 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for replys.

As I said the memory of computer is 1GB, it should not be the problem.

I use ANT to build files.

I compiled successfully even for 651 files before. Those 648 files are different versions from those 651 files, just many source code changes.

Any suggestions?
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could try increasing the maximum heap size for the Ant process. In Ant 1.6 I believe you add it to (or set) the environment variable ANT_OPTS. Check the JDK tools documentation for the switch: -mX$$$ IIRC.
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This belongs in our "Ant and other build tools" forum. I'll move it there.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sarah Marsh:

As I said the memory of computer is 1GB, it should not be the problem.



As far as I know, Java won't use more than 64MB per default, independently of how RAM you actually have. If you want it to use more, you need to tell it via the -X... switches.
 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I set

ANT_OPTS=-Xmx500M

It works. Thanks a lot for all your help!
reply
    Bookmark Topic Watch Topic
  • New Topic