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: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to