aspose file tools*
The moose likes Performance and the fly likes how outofMemoryError canbe avoided Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "how outofMemoryError canbe avoided" Watch "how outofMemoryError canbe avoided" New topic
Author

how outofMemoryError canbe avoided

Giri dhar
Greenhorn

Joined: Aug 31, 2007
Posts: 7
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

Joined: Oct 30, 2001
Posts: 1970
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.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Giri dhar
Greenhorn

Joined: Aug 31, 2007
Posts: 7
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

Joined: Oct 30, 2001
Posts: 1970
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

Joined: Aug 31, 2007
Posts: 7
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

Joined: Mar 22, 2000
Posts: 12781
    
    5
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

Joined: Aug 31, 2007
Posts: 7
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

Joined: Mar 22, 2000
Posts: 12781
    
    5
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)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how outofMemoryError canbe avoided