Hello all!

Have always disliked people sending offtopic,
but:

looks like I've caught a bug in JDK 1.4.0-beta
for windows?
Please, does anybody out there have JDK 1.4.1-RC
(their latest one)?

Could you please run the test and send me the
output? The main question is does the test
run out of memory or not?

It does not run out of memory on JDK 1.3.1

Looks like they have got something wrong with
their WeakHashMap or with WeakReference.

BTW: any better mail list/newsgroup for things like this?
     do not like the forums on sun, prefer a mail solution.


-------------
java -Xmx16Mb R
-------------
import java.util.*;

public class R{
  static int counter = 1; final static int maxIter = 160000;
  static Map map = new WeakHashMap();

  static void measureMem(){
    int i=0;
    try{
      byte[][] d = new byte[maxIter][];
      for(;i<maxIter;++i) d[i] = new byte[16*1024];
      System.out.println("plz increase maxIter");
    }catch(OutOfMemoryError e){
      //free mem is
      System.out.println(i);
    }
  }


  public static void main(String[] args){
    Object obj= new Object();
    map.put(obj,obj); map.remove(obj);
    obj=null;
    while(true){
      measureMem();
      map.put( new Integer( counter++ ), new byte[512*1024] );
    }
  }
}
--------------------------------------
--
TIA
 Anton                          mailto:[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to