From owner-freebsd-java Sat Nov 24 22:10:26 2001 Delivered-To: freebsd-java@freebsd.org Received: from web20410.mail.yahoo.com (web20410.mail.yahoo.com [216.136.226.129]) by hub.freebsd.org (Postfix) with SMTP id 2ABB937B416 for ; Sat, 24 Nov 2001 22:10:22 -0800 (PST) Message-ID: <20011125061021.71089.qmail@web20410.mail.yahoo.com> Received: from [203.93.190.91] by web20410.mail.yahoo.com via HTTP; Sat, 24 Nov 2001 22:10:21 PST Date: Sat, 24 Nov 2001 22:10:21 -0800 (PST) From: huang wen hui Subject: GC is not work in jdk1.3.1p5+OpenJIT1.1.16 To: freebsd-java@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org hi, Here is the sample code: ----------------------------------------- import java.util.LinkedList; import java.util.List; import javax.swing.event.EventListenerList; public class FixQueue extends Object{ protected EventListenerList listenerList = new EventListenerList(); private FixQueueException fixQueueExcep = new FixQueueException("Queue's MaxQueueLength is Exceed"); private LinkedList list; private int maxQueueSize; protected String queueID =""; public FixQueue(int newMaxQueueSize, String queueID) { maxQueueSize = newMaxQueueSize; this.queueID = queueID; list = new LinkedList (); } public synchronized int getListenerCount() { return listenerList.getListenerCount(); } public void addBack(Object obj) { list.addLast (obj); if ( list.size () > maxQueueSize ){ list.removeFirst (); } } protected void addBackNoNotify(Object obj){ list.addLast (obj); if ( list.size () > maxQueueSize ){ list.removeFirst (); } } public Object getFront() { return list.getFirst (); } public Object getBack() { return list.getLast (); } public boolean isEmpty() { return list.isEmpty (); } public void popFront() { list.removeFirst (); } public Object at(int index) { return list.get (index); } public int getSize(){ return list.size(); } public int getMaxQueueSize(){ return maxQueueSize; } public String getQueueID(){ return queueID; } public static void main( String[] argv ){ FixQueue fixQueue = new FixQueue(4096,"ID"); while(true) { fixQueue.addBack(new byte[4096]); } } } class FixQueueException extends Exception { public FixQueueException() { super(); } public FixQueueException(String s) { super(s); } } ----------------------------------------- when run under jdk1.3.1p5 that enable OpenJIT1.1.16, the program will eat a lot of memory as posible as it can. and error msg is : Exception in thread "main" java.lang.StackOverflowError at java.util.LinkedList.addBefore(LinkedList.java, Compiled Code) at java.util.LinkedList.addLast(LinkedList.java, Compiled Code) at FixQueue.addBack(FixQueue.java, Compiled Code) at FixQueue.main(FixQueue.java, Compiled Code) If disable OpenJIT, it worked as expected. --hwh __________________________________________________ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message