Creating Array - OurOfMemory Exception

double arr[] =newdouble[4194304];

long arrLong[] =newlong [4194304]; <--//ERROR

Creating arrays of length 4194304.0

Exception in thread"main" java.lang.OutOfMemoryError: Java heap space

Is there any JVM switch or something else by which i can increase the Java Program in JVM so that I may declare 2 arrays of that size.

[614 byte] By [M.Ali.Amina] at [2007-11-27 8:41:53]
# 1
you can use "-Xms" and "-Xmx" params when you launch java, to define the min and max memory space allocated to the prog
calvino_inda at 2007-7-12 20:41:02 > top of Java-index,Java Essentials,Java Programming...
# 2
Correct use something like this -Xms512m -Xmx1024m
veppadaia at 2007-7-12 20:41:02 > top of Java-index,Java Essentials,Java Programming...
# 3
ahan .. thanks. How can change the JVM parameter from my program?
M.Ali.Amina at 2007-7-12 20:41:02 > top of Java-index,Java Essentials,Java Programming...