FileHandleGcTest.out: New file.
2001-12-20 Andrew Haley <aph@redhat.com> * libjava.lang/FileHandleGcTest.out: New file. * libjava.lang/FileHandleGcTest.java: New file. * libjava.lang/Array_3.out: New file. * libjava.lang/Array_3.java: New file. From-SVN: r48201
This commit is contained in:
committed by
Andrew Haley
parent
bcdd764b27
commit
76eceb1ec3
@@ -0,0 +1,24 @@
|
||||
// Make sure that file handles are garbage collected.
|
||||
import java.io.*;
|
||||
public class FileHandleGcTest
|
||||
{
|
||||
static void kill () throws FileNotFoundException
|
||||
{
|
||||
for (int i = 0; i < 65536; i++)
|
||||
{
|
||||
FileInputStream f = new FileInputStream ("/dev/null");
|
||||
}
|
||||
}
|
||||
|
||||
public static void
|
||||
main (String argv [])
|
||||
{
|
||||
try
|
||||
{
|
||||
kill ();
|
||||
}
|
||||
catch (FileNotFoundException _)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user