Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how outofMemoryError canbe avoided

 
Giri dhar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have modified and addded certain files related to my project work.When I run bc(buildclean)I recieve the following error followed by warnings.and I could not proceed further..the error msg i recieved when i ran bc on my machine is


Util.java:52: warning: getYear() in java.util.Date has been deprecated
[javac] year.add(currMonth + " " + (cal.getTime().getYear()+19
00));
[javac] ^
[javac]
[javac]
[javac] The system is out of resources.
[javac] Consult the following stack trace for details.
[javac]
[javac] java.lang.OutOfMemoryError
[javac] <<no stack trace available>>

BUILD FAILED..


There are no errors when i run onjdk 1.4.but i reciev this on jdk 1.3.
I tried java -Xmx128m on console but i still recieve this: java -Xms128m
>Error occurred during initialization of VM
>Incompatible initial and maximum heap sizes .server is jboss2 and my machine is windows xp.

Thanks,
Giridhara

{Edit: Please read this.]
[ September 04, 2007: Message edited by: Bear Bibeault ]
[ September 04, 2007: Message edited by: Bear Bibeault ]
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's very unclear to me what your problem is and when it occurs.

The -Xms argument to a JVM has to be less than the -Xmx (or its default). I think the default -Xmx may be 64M, so you are trying to set a minimum of 128MB at the same time as a maximum of 64MB.

If javac is the thing that's running out of memory, you can pass JVM arguments (e.g. -Xms, -Xmx) to it using -J option. Look up the tool docs for javac.
 
Giri dhar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recieve java.lang.OutOfMemoryError when I run build


I tried java-Xms(minimum size) and Xmx(Maximum size) on console for increasing heapsize memory.. I recieve this errormsg "Error occurred during initialization of VM
Could not reserve enough space for object heap"
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, that sounds like your machine really does not have enough virtual memory to serve up the size of heap you requested. How much did you request? Is your machine particularly puny, or particularly heavily-loaded?
 
Giri dhar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
virtual memory is 1524 MB...and Heap sizes are
heapSize2031616
heapMaxSize66650112
heapFreeSize1915024.

I dont think my machine is loaded heavily bcause I dont recieve this out of memory error when I run other java applications on my machine .
I m not able to change heapsizes using java-Xms and java-Xmx from my console
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13062
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recieve java.lang.OutOfMemoryError when I run build


When you say "run build" what exactly does that mean. Are you using an IDE, running ANT task(s) or directly executing the compiler?

Bill
 
Giri dhar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Bill,while running ANT Task to build I m facing this error
[ September 05, 2007: Message edited by: Giri dhar ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13062
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you telling the ANT tasks the memory settings to use? Perhaps the process is not using the -Xms etc settings from the command line but is using the default 64mb value.

This query might belong in the ANT forum.

Bill (who uses ANT but doesn't know anything about such details)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic