1 // Make sure that file handles are garbage collected.
2 import java.io.*;
3 public class FileHandleGcTest
4 {
kill()5   static void kill () throws FileNotFoundException
6   {
7     for (int i = 0; i < 65536; i++)
8       {
9 	FileInputStream f = new FileInputStream ("/dev/null");
10       }
11   }
12 
13   public static void
main(String argv [])14   main (String argv [])
15   {
16     try
17       {
18 	kill ();
19       }
20     catch (FileNotFoundException _)
21       {
22       }
23   }
24 }
25