Hi

Thanks for the reply.

I’m still not sure exactly what you meant with the open file issue. If the
open file is counted one per thread, is the file open for each thread or
only reported as open. If so lsof might not be accurate with threads ??

The reason we started looking at the open files is, we where having IO
problems. After running for about 1 day, Linix started reporting IO errors
and stating that it couldn’t open any more files.

The other concern or question is, should the handle to a referenced jar file
not be closed at some point?

Thanks
Jeff

> -----Original Message-----
> From: Anders Lindback [mailto:[EMAIL PROTECTED]]
> Sent: 03 October 2001 12:21
> To: Jeff Singer
> Cc: [EMAIL PROTECTED]
> Subject: Re: Linux - Java Open Files
>
>
> Jeff Singer skrev:
> > I start a number of java applications (JDK 1.3.1_01) on our Red
> hat 6.2 box.
> > Now as I understand what happens is, when a thread is spawned,
> each thread
> > is cloned and becomes its own process. This is since JDK 1.3.x,
> while JDK
> > 1.2.x used green threads.
>
> Actualyy no they do not become their own process. In the Linux a thread
> gets a process entry so that it looks and behaves like a process for
> scheduling etc. But a thread is not a process.
>
> > What I need to understand is, do they share the same memory?
> And the same
> > files?
>
> All threads share their memory open files etc thisi whats
> separate them from
> normal processes.
>
> > The problem I am having is the number of files that are opened by my
> > applications. Listed using lsof. It seems that each thread
> (each process)
> > has a handle to each jar file that it references. For example,
> after I have
> > started all my applications I have about 600 java processes
> running on the
> > Linux box. Doing the following “lsof | grep log4j.jar --count"
> will return
> > about 580 instances.
> >
> > Doing a complete count on all the files open by the user who starts the
> > application, I get about 55000 open files ????????
>
> Each open files are counted 580 times - one for each thread - thus
> the program containging all threads has about 100 open files.
>
> Anders


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to