|
Last change
on this file was 2, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
413 bytes
|
| Line | |
|---|
| 1 | // Make sure that file handles are garbage collected.
|
|---|
| 2 | import java.io.*;
|
|---|
| 3 | public class FileHandleGcTest
|
|---|
| 4 | {
|
|---|
| 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
|
|---|
| 14 | main (String argv [])
|
|---|
| 15 | {
|
|---|
| 16 | try
|
|---|
| 17 | {
|
|---|
| 18 | kill ();
|
|---|
| 19 | }
|
|---|
| 20 | catch (FileNotFoundException _)
|
|---|
| 21 | {
|
|---|
| 22 | }
|
|---|
| 23 | }
|
|---|
| 24 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.