OutOfMemory? With an huge array how I can avoid it?

In runtime i got the OutOfMemoryError (or exception... I don't remember) when bulding an huge array... So i would like to know which dimension has usually the heap memory, if it depends from the machine you're using, and how i can avoid that error, without creating a List...

I need the array to create a simple program for school wich will split a file in n parts, so I need to use an array of bytesn but if the file bigger than about 50mb it appears the OutOfMemory above...

Any suggestions accepted (you'll see i'm a newbie), Thanks

[558 byte] By [ArgHa] at [2007-10-2 20:12:54]
# 1
Default max memory is 64MB.This tells you all the details about java.exe: http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/java.htmlAnd this is the option you want to use: -Xmx
Lokoa at 2007-7-13 22:54:57 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

> In runtime i got the OutOfMemoryError (or

> exception... I don't remember) when bulding an huge

> array... So i would like to know which dimension has

> usually the heap memory, if it depends from the

> machine you're using, and how i can avoid that error,

> without creating a List...

A list is unlikely to take less room than an array.

jschella at 2007-7-13 22:54:57 > top of Java-index,Java HotSpot Virtual Machine,Specifications...