Skip site navigation (1)Skip section navigation (2)
Date:      Wed,  3 Mar 1999 10:03:54 -0800 (PST)
From:      swohlgemuth@hotmail.com
To:        freebsd-gnats-submit@freebsd.org
Subject:   ports/10373: Increasing kernel file descriptors causes jdk1.1.7 to core dump after opening >20## ports
Message-ID:  <19990303180354.7B90D15548@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         10373
>Category:       ports
>Synopsis:       Increasing kernel file descriptors causes jdk1.1.7 to core dump after opening >20## ports
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar  3 10:10:01 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     Sean Wohlgemuth
>Release:        3.1-RELEASE
>Organization:
>Environment:
FreeBSD shadowtroll1.xxx.xxx.com 3.1-RELEASE FreeBSD 3.1-RELEASE #2: Wed Mar  3 09:12:26 PST 1999     root@shadowtroll1.xxx.xxx.com:/usr/src/sys/com
pile/SEANWOKERNEL  i386
>Description:
After increasing the max file descriptors in the kernel so that I can test a new server application by simulating thousands of clients, I try to run a java application that opens thousands of persistent connections to the server and the jdk/application core dumps after 
>How-To-Repeat:
***KERNEL TUNING***
change kernel to increase file descriptors:
  /usr/src/sys/compile/SEANWOKERNEL/param.c
  change #define MAXFILES (NPROC * 2) to #define MAXFILES 5000
  make depend; make; make install; reboot...

run a java program using JDK1.1.7 to open ~5000 sockets to a server

this results in a coredump after about ~2020 sockets have been opened

***.java file***
/*here is the class file that can make it happen after kernel tunning is complete... change server and port to your own test system*/

import java.net.*;
import java.io.*;

public class Class1
{
	public static int iSockets=4000;
	
	public static void main (String[] args)
	{
		Socket[] m_rgoSocket=new Socket[iSockets];
		OutputStream[] m_rgoOutputStream=new OutputStream[iSockets];
		
		int i=0;
		int j=iSockets;
		try{
			for (i=0; i<iSockets; i++){
				m_rgoSocket[i] = new Socket("www.yahoo.com", 80);			
				m_rgoOutputStream[i] = m_rgoSocket[i].getOutputStream();
				System.out.print(i+" ");
				System.out.flush();
			}//endfor
		}
		catch (UnknownHostException e){}
		catch (IOException e1){
			System.out.println();
			System.out.println("IOException:"+e1);
			j=i-1;
		}//endcatch
		System.out.println("Sockets opened successfully: "+i);
		System.out.println("Closing open sockets...");
		try{
			for (i=0; i<j; i++){
					m_rgoSocket[i].close();
			}//endfor
		}catch (IOException e){
		}//endcatch
		System.out.println("Done");
		try{
			System.in.read();
		}catch (IOException e){}
	}//endmethod
	
}//endclass

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990303180354.7B90D15548>