In JDK 1.2 the default max heap size is 16 Mb - I can't remember what
it was in 1.1. Is this your problem ? You can specify a larger heap
with the command line option -Xmx32m, for example.
Nick

Luigi Giuri wrote:

> I'm having a problem using jdk117_v1a + Apache-JServ-1.0b3.
>
> The problem is that sometimes a java.lang.OutOfMemoryError occurs,
> so I need to restart the JVM.
>
> To test the jdk, I wrote the following simple program:
>
> import java.util.*;
>
> public class crashMe
> {
>   public static void main(String [] argv)
>     throws Throwable
>   {
>     try
>     {
>       Vector v = new Vector();
>
>       int i = 0;
>       while (true)
>       {
>         v.addElement(
>           new StringBuffer(10000));
>         System.out.println(++i);
>       }
>     } catch (Throwable e) {
>       System.out.println("Exception!!! Press <Return> to continue...");
>       System.in.read();
>       throw e;
>     }
>   }
> }
>
> The objective of this program is to fill the computer RAM and swap area but,
> suddendly, when it crashes with a java.lang.OutOfMemoryError there are
> 66000 KB of free RAM (on a 96MB computer).
>
> I tried the jdk117_v3, but I obtained the same result.
> I also turned off the JIT compiler.
>
> Here is the command line:
>
> $ /usr/local/jdk117_v3/bin/java -classpath
> .:/usr/local/jdk117_v3/lib/classes.zip -Djava.compiler=NONE crashMe
>
> In my computer the above program crashes at iteration n. 525.
> If I allocate StringBuffer(1000000) (one million) it crashes after
> four iterations.
>
> What's the problem?
>
> Luigi Giuri
>
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to