Hi,

I've noticed weird behavior with JDK1.1.7a (Suse 6.0) that I didn't see
with JDK 1.1.6:  When doing the most basic system exec, and then reading
in the stdin, Java frequently hiccups, for a good second or two, usually
when garbage is collected.

I found this because I've written a port of GNU find to Java that is
cross-platform, but will detect when used on Linux or FreeBSD, and use
GNU tools if it can to speed things up. (
http://www.rule-of-eight.com/components/javafind ).

Here's a small class that demonstrates the problem by calling a command
that generates a lot of output.  It doesn't hiccup as much as my Find
class does, but it still shows the effect:
-------
import java.io.*;

class SystemTest {
    public static void main(String[] args) throws IOException {
        Process p  = Runtime.getRuntime().exec("/usr/bin/find /usr");

        BufferedReader in = new BufferedReader(
            new InputStreamReader(
                p.getInputStream()));

        String line;
        while ((line = in.readLine()) != null) {
            System.out.println(line);
        }
        in.close();
    }
}
-------

- Robb


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

Reply via email to