harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <g...@pobox.com>
Subject [drlvm] Thread me tender, thread me true, never throw an OOM...
Date Mon, 16 Oct 2006 23:29:49 GMT
So, with
> public class Test implements Runnable {
>     static int i = 0;
>     public void run() {
>         try {
>             Thread.sleep(1);
>         } catch (Throwable e) { 
>             e.printStackTrace();
>         }
>     }
> 
>     Test() {
>         new Thread(this).start();
>     }
> 
>     public static void main(String args[]) {
>         for(;;) {
>           i++;
>           if (i % 1000 == 0) {
>                 System.out.println("Iteration: " + i);
>           }
>           new Test();
>         }
>     }
> }

How far do you get? I get to 340...  and then OOM.  Why are threads so 
heavy?

geir

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message