Java: how to increase memory limit on 64-bit win 7

andy7789
andy7789 used Ask the Experts™
on
Hi X-perts,

I am getting JVM "out of memory" messages when running my XML mapping applications on Win 7 64 bit.

The same application runs fine on my old Win XP 32-bit machine.

how can I fix this?

thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mick BarryJava Developer
Top Expert 2010

Commented:
increase the memory allocation with -Xmx command line option
Mick BarryJava Developer
Top Expert 2010

Commented:

Author

Commented:
Thanks. What should be MyClassName in

java -Xms32m -Xmx128m MyClassName

?

If I want to increase it for all applications using JVM, how should I specify MyClassName ?
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

Java Developer
Top Expert 2010
Commented:
> What should be MyClassName in

the class containing the main() you want to run

> If I want to increase it for all applications using JVM, how should I specify MyClassName ?

you would specify the mx option in the java control panel
Mick BarryJava Developer
Top Expert 2010

Commented:
if you use a script to startup your app then you may need to change the startup options in the script

Author

Commented:
Sorry for as the obvious, but how to specify the mx option in the java control panel?

I am not a "Java-man"....
Mick BarryJava Developer
Top Expert 2010

Commented:
theres an option in there somewhere (I don't have a windows box open at the moment) that lets you specify startup options
goto Control Panel and open Java, you should be able to find it

Author

Commented:
Thank you, I will try to find it. what is the max setting Xmx for 64-bit machines? I remember, for win xp 32-bit it was 512m (if i am right).

can I set it 1024m and more?
Mick BarryJava Developer
Top Expert 2010

Commented:
not sure if there is a limit, I've certsainly set it to many gigs eg. -Xmx4g

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial