public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Stephen Crawley <crawley@dstc.edu.au>
To: Mark Wielaard <mark@klomp.org>
Cc: Stephen Crawley <crawley@dstc.edu.au>,
	Noa Resare <noa@resare.com>,
	Mauve Discuss <mauve-discuss@sources.redhat.com>,
	crawley@piglet.dstc.edu.au, crawley@piglet.dstc.edu.au
Subject: Re: gnu/testlet/java/nio/channels/FileChannel/manyopen.java broken
Date: Mon, 11 Oct 2004 00:50:00 -0000	[thread overview]
Message-ID: <200410110049.i9B0nLQQ008866@piglet.dstc.edu.au> (raw)
In-Reply-To: Message from Mark Wielaard <mark@klomp.org>  of "Fri, 08 Oct 2004 12:05:25 +0200." <1097229925.1087.10.camel@localhost>


Mark Wielaard <mark@klomp.org> wrote:
> We had a problem with real programs that open lots of files quickly
> (gjdoc does this for example, a jar tool or a webserver might be another
> good example) and don't explicitly close these files, but let the
> file/stream just get garbage collected since the program structure
> doesn't explicitly define a "owner" for the file/stream object (which
> isn't that uncommon since that is what you normally do with random
> allocated objects, long life the garbage collector!).

Java programs that rely on the GC to find / close file handles are
non-portable and (IMO) broken.  A portable program cannot depend on
the GC running soon enough to get around a problem with running
out of file descriptors.  Indeed, it cannot even reliably cause the
VM to run the garbage collector, because the VM is allowed to treat 
a call to java.lang.System.gc() as a "hint" ... and ignore it.

[For the record, Kissme is currently implemented to only respect 
calls to java.lang.System.gc() when it is launched with the "-gc"
command line option.]

> What I think should be tested is whether a program can open lots of
> files. And that the systems notices that stale file handle resources can
> be removed so that a program can keep opening files if needed. (As long
> as there are no large number of life file handles open at the same
> time.)

The trouble is that you cannot write a portable / reliable testcase for 
this.  Even if you could, I do not believe that a Java VM should be 
required to be able to run programs that leak file descriptors like this.

> Since I have seen multiple systems get this wrong in various ways I want
> to have an explicit test for this situation. It might be that this test
> does not simulate a real world program correctly, so if there are
> alternatives I would like to hear them instead of just deleting the test
> since some systems fail it.

I think the solution is to test for behaviour that is not required by
the Java 'specification' in a VM-specific test suite ... not in Mauve.

-- Steve

  parent reply	other threads:[~2004-10-11  0:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-08  6:35 Noa Resare
2004-10-08  6:47 ` Stephen Crawley
2004-10-08 10:05   ` Mark Wielaard
2004-10-08 11:07     ` Noa Resare
2004-10-08 17:00     ` Thomas Zander
2004-10-11  0:50     ` Stephen Crawley [this message]
2004-10-11  6:39 Jeroen Frijters

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200410110049.i9B0nLQQ008866@piglet.dstc.edu.au \
    --to=crawley@dstc.edu.au \
    --cc=crawley@piglet.dstc.edu.au \
    --cc=mark@klomp.org \
    --cc=mauve-discuss@sources.redhat.com \
    --cc=noa@resare.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).