Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 23346 invoked from network); 2 Sep 2008 13:48:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Sep 2008 13:48:09 -0000 Received: (qmail 80870 invoked by uid 500); 2 Sep 2008 13:48:05 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 80836 invoked by uid 500); 2 Sep 2008 13:48:05 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 80820 invoked by uid 99); 2 Sep 2008 13:48:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 06:48:05 -0700 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=DNS_FROM_OPENWHOIS,FORGED_YAHOO_RCVD,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 13:47:07 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1KaWEL-0000M5-5W for dev@directory.apache.org; Tue, 02 Sep 2008 06:47:37 -0700 Message-ID: <19270605.post@talk.nabble.com> Date: Tue, 2 Sep 2008 06:47:37 -0700 (PDT) From: JhuneRGeronimo To: dev@directory.apache.org Subject: Re: MINA In-Reply-To: <439FE4C4.5070306@trillian.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: jhune.geronimo@yahoo.com References: <1375EA86797CCC4AA5691617718CA19C4BEAAF@kappa.consignit.se> <439FE4C4.5070306@trillian.se> X-Virus-Checked: Checked by ClamAV on apache.org Geronimo wrote: > > Hi, > > I had run this simple code below for 2 hours and look what happen... Is > there anybody explain and help me why a simple test like this will hit the > memory. > > my Server : > > public class Server2 { > > > public static void main(String[] args) throws IOException { > > > ByteBuffer.setUseDirectBuffers(false); > ByteBuffer.setAllocator(new SimpleByteBufferAllocator()); > > > int PORT = 8999; > IoAcceptor acceptor = new SocketAcceptor(2, > Executors.newCachedThreadPool()); > > IoServiceConfig cfg = acceptor.getDefaultConfig(); > TextLineCodecFactory factory = new > TextLineCodecFactory(Charset.forName("UTF-8")); > factory.setDecoderMaxLineLength(2048); > > cfg.getFilterChain().addLast("codec", new ProtocolCodecFilter(factory)); > acceptor.bind(new InetSocketAddress(PORT), new ioHandler(), cfg); > > } > } > > > my Handler > > public class ioHandler extends IoHandlerAdapter { > public void exceptionCaught(IoSession session, Throwable t) throws > Exception { > t.printStackTrace(); > session.close(); > } > > public void messageReceived(IoSession session, Object msg) throws > Exception { > String str = msg.toString(); > if( str.trim().equalsIgnoreCase("quit") ) { > session.close(); > return; > } > Date date = new Date(); > Thread.sleep(840); > for(int i = 0 ;i<1000000; i++ ){ > Thread.sleep(100); > session.write("\n > 010101010101010101010101 > " + i + "\n" ); > } > > WriteFuture sw = session.write( date.toString() ); > > System.out.println("Message written..."); > } > > public void sessionCreated(IoSession session) throws Exception { > System.out.println("Session created..."); > > if( session.getTransportType() == TransportType.SOCKET ) > ((SocketSessionConfig) session.getConfig() ).setReceiveBufferSize( 2048 > ); > > session.setIdleTime( IdleStatus.BOTH_IDLE, 10 ); > } > } > > > result for 2 HOURS... > > http://www.nabble.com/file/p19248923/mina.jpg > -- View this message in context: http://www.nabble.com/MINA-tp1936663p19270605.html Sent from the Apache Directory Project mailing list archive at Nabble.com.