File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes setting -Xmx1024m on Java command? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "setting -Xmx1024m on Java command?" Watch "setting -Xmx1024m on Java command?" New topic

setting -Xmx1024m on Java command?

medhaj hambi
Ranch Hand

Joined: Jun 04, 2008
Posts: 34
Hi...I have an application that runs out of memory frequently. I have learnt that we can use this so that that error may not occur. Can anyone tell me how to set
that particular variable permanantly...unlike just doing it run time. The reason why I was asking is...I am having an application that uses Java compiler and I donot know the reason but, I see that the program runs out of memory. So, I want to set this value permanantly as I donot use the command line option for that. I am using a particular tool.
That will be great if someone could shed some light on this.

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46362
Probably better to find out why your application is running out of memory.
David Newton

Joined: Sep 29, 2008
Posts: 12617

And use a batch/shell program to run the program with that argument until you do.
I agree. Here's the link:
subject: setting -Xmx1024m on Java command?
It's not a secret anymore!