Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 71387 invoked from network); 27 Mar 2002 13:32:44 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 27 Mar 2002 13:32:44 -0000 Received: (qmail 28118 invoked by uid 97); 27 Mar 2002 13:32:42 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 28091 invoked by uid 97); 27 Mar 2002 13:32:42 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 28080 invoked by uid 97); 27 Mar 2002 13:32:42 -0000 Date: 27 Mar 2002 13:32:40 -0000 Message-ID: <20020327133240.37590.qmail@icarus.apache.org> From: hammant@apache.org To: jakarta-commons-sandbox-cvs@apache.org Subject: cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test MemoryLeak.java MemoryLeakClientTest.java MemoryLeakImpl.java MemoryLeakServerTest.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N hammant 02/03/27 05:32:40 Added: altrmi/src/java/org/apache/commons/altrmi/test MemoryLeak.java MemoryLeakClientTest.java MemoryLeakImpl.java MemoryLeakServerTest.java Log: memory leak tests. Revision Changes Path 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/MemoryLeak.java Index: MemoryLeak.java =================================================================== /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.test; public interface MemoryLeak { MemoryLeak getNewMemoryLeak(); } 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/MemoryLeakClientTest.java Index: MemoryLeakClientTest.java =================================================================== /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.test; import org.apache.commons.altrmi.client.AltrmiHostContext; import org.apache.commons.altrmi.client.AltrmiFactory; import org.apache.commons.altrmi.common.AltrmiConnectionException; import org.apache.commons.altrmi.client.impl.socket.SocketObjectStreamHostContext; import org.apache.commons.altrmi.client.impl.socket.SocketCustomStreamHostContext; import org.apache.commons.altrmi.client.impl.ServerClassAltrmiFactory; import org.apache.commons.altrmi.client.impl.ClientClassAltrmiFactory; import java.io.IOException; /** * Class MemoryLeakClientTest * * * @author Paul Hammant Paul_Hammant@yahoo.com * @version $Revision: 1.1 $ */ public class MemoryLeakClientTest { /** * Constructor MemoryLeakClientTest * * * @param ml * */ public MemoryLeakClientTest(MemoryLeak ml) { long start = System.currentTimeMillis(); for (int i = 0; i < 100000000; i++) { MemoryLeak tmpMl = ml.getNewMemoryLeak(); System.gc(); // pointless ? if (("" + i).endsWith("000")) { long end = System.currentTimeMillis(); System.out.println("Iter " + i + ", " + (end-start) / 1000 + " seconds, Tot Mem :" + Runtime.getRuntime().totalMemory() + ", Max Mem :" + Runtime.getRuntime().maxMemory() + ", Free Mem :" + Runtime.getRuntime().freeMemory() ); end = start; } } } /** * Method main * * * @param args * * @throws Exception * */ public static void main(String[] args) throws Exception { System.out.println("Memory Leak Client"); AltrmiFactory af = new ClientClassAltrmiFactory(false); af.setHostContext(new SocketCustomStreamHostContext("127.0.0.1", 1277)); MemoryLeak ml = (MemoryLeak) af.lookup("MemLeak"); new MemoryLeakClientTest(ml); af.close(); } } 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/MemoryLeakImpl.java Index: MemoryLeakImpl.java =================================================================== /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.test; public class MemoryLeakImpl implements MemoryLeak { public MemoryLeak getNewMemoryLeak() { System.gc(); // pointless ? return new MemoryLeakImpl(); } } 1.1 jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/test/MemoryLeakServerTest.java Index: MemoryLeakServerTest.java =================================================================== /* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.altrmi.test; import org.apache.commons.altrmi.server.impl.socket.CompleteSocketCustomStreamServer; import org.apache.commons.altrmi.server.impl.AbstractServer; import org.apache.commons.altrmi.server.PublicationDescription; import java.io.IOException; /** * Class MemoryLeakServerTest * * * @author Paul Hammant Paul_Hammant@yahoo.com * @version $Revision: 1.1 $ */ public class MemoryLeakServerTest { /** * Method main * * * @param args * * @throws Exception * */ public static void main(String[] args) throws Exception { System.out.println("MemoryLeak Server"); AbstractServer as = new CompleteSocketCustomStreamServer(1277); MemoryLeakImpl ml = new MemoryLeakImpl(); as.publish(ml, "MemLeak", new PublicationDescription(MemoryLeak.class, MemoryLeak.class)); as.start(); } } -- To unsubscribe, e-mail: For additional commands, e-mail: