< prev index next >

test/jdk/java/nio/channels/FileChannel/LargeMapTest.java

Print this page

20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  */
23 
24 import jdk.test.lib.RandomFactory;
25 
26 import java.lang.foreign.Arena;
27 import java.lang.foreign.MemorySegment;
28 
29 import java.io.IOException;
30 import java.nio.ByteBuffer;
31 import java.nio.channels.FileChannel;
32 import java.nio.file.Path;
33 import java.util.Random;
34 import java.util.concurrent.TimeUnit;
35 
36 import static java.nio.file.StandardOpenOption.*;
37 
38 /*
39  * @test
40  * @enablePreview
41  * @bug 8286637
42  * @summary Ensure that memory mapping beyond 32-bit range does not cause an
43  *          EXCEPTION_ACCESS_VIOLATION.
44  * @requires vm.bits == 64
45  * @library /test/lib
46  * @build jdk.test.lib.RandomFactory FileChannelUtils
47  * @run main/othervm LargeMapTest
48  * @key randomness
49  */
50 public class LargeMapTest {
51     private static final long LENGTH = (1L << 32) + 512;
52     private static final int  EXTRA  = 1024;
53     private static final long BASE   = LENGTH - EXTRA;
54     private static final Random GEN  = RandomFactory.getRandom();
55 
56     public static void main(String[] args) throws IOException {
57         System.out.println(System.getProperty("sun.arch.data.model"));
58         System.out.println(System.getProperty("os.arch"));
59         System.out.println(System.getProperty("java.version"));
60 

20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  */
23 
24 import jdk.test.lib.RandomFactory;
25 
26 import java.lang.foreign.Arena;
27 import java.lang.foreign.MemorySegment;
28 
29 import java.io.IOException;
30 import java.nio.ByteBuffer;
31 import java.nio.channels.FileChannel;
32 import java.nio.file.Path;
33 import java.util.Random;
34 import java.util.concurrent.TimeUnit;
35 
36 import static java.nio.file.StandardOpenOption.*;
37 
38 /*
39  * @test

40  * @bug 8286637
41  * @summary Ensure that memory mapping beyond 32-bit range does not cause an
42  *          EXCEPTION_ACCESS_VIOLATION.
43  * @requires vm.bits == 64
44  * @library /test/lib
45  * @build jdk.test.lib.RandomFactory FileChannelUtils
46  * @run main/othervm LargeMapTest
47  * @key randomness
48  */
49 public class LargeMapTest {
50     private static final long LENGTH = (1L << 32) + 512;
51     private static final int  EXTRA  = 1024;
52     private static final long BASE   = LENGTH - EXTRA;
53     private static final Random GEN  = RandomFactory.getRandom();
54 
55     public static void main(String[] args) throws IOException {
56         System.out.println(System.getProperty("sun.arch.data.model"));
57         System.out.println(System.getProperty("os.arch"));
58         System.out.println(System.getProperty("java.version"));
59 
< prev index next >