Skip to content

Commit d76001a

Browse files
authored
Add files via upload
1 parent f72c9b0 commit d76001a

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

java/ojvm/memtest.sql

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
REM
2+
REM
3+
REM ------------------------------------------------------------------------------
4+
REM Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
5+
REM
6+
REM Portions Copyright 2006-2015, Kuassi Mensah. All rights reserved.
7+
REM https://www.amazon.com/dp/1555583296
8+
REM
9+
REM ------------------------------------------------------------------------------
10+
REM DESCRIPTION
11+
REM
12+
REM The following code sample is provided for illustration purposes only.
13+
REM The default values should work for most applications.
14+
REM Before altering these values for your production system, please
15+
REM test beforehand
16+
REM
17+
18+
19+
create or replace and resolve java source named memtest as
20+
import oracle.aurora.vm.OracleRuntime;
21+
public class memtest
22+
{
23+
24+
public static void Tests ()
25+
{
26+
System.out.println("getSessionSize(): "
27+
+ OracleRuntime.getSessionSize());
28+
29+
System.out.println("Old NewspaceSize(): "
30+
+ OracleRuntime.getNewspaceSize());
31+
OracleRuntime.setNewspaceSize(2 * OracleRuntime.getNewspaceSize());
32+
System.out.println("New NewspaceSize(): "
33+
+ OracleRuntime.getNewspaceSize());
34+
35+
System.out.println("Old MaxRunspaceSize(): "
36+
+ OracleRuntime.getMaxRunspaceSize());
37+
OracleRuntime.setMaxRunspaceSize(2 * OracleRuntime.getMaxRunspaceSize());
38+
System.out.println("New MaxRunspaceSize(): "
39+
+ OracleRuntime.getMaxRunspaceSize());
40+
41+
System.out.println("getJavaPoolSize(): "
42+
+ OracleRuntime.getJavaPoolSize());
43+
System.out.println("getSessionSoftLimit(): "
44+
+ OracleRuntime.getSessionSoftLimit());
45+
System.out.println("Old SessionGCThreshold(): "
46+
+ OracleRuntime.getSessionGCThreshold());
47+
OracleRuntime.setSessionGCThreshold(2 * OracleRuntime.getSessionGCThreshold());
48+
System.out.println("New SessionGCThreshold(): "
49+
+ OracleRuntime.getSessionGCThreshold());
50+
51+
System.out.println("Old NewspaceSize: " + OracleRuntime.getNewspaceSize());
52+
OracleRuntime.setNewspaceSize(2 * OracleRuntime.getNewspaceSize());
53+
System.out.println("New NewspaceSize: " + OracleRuntime.getNewspaceSize());
54+
55+
System.out.println("Old MaxMemsize: " + OracleRuntime.getMaxMemorySize());
56+
OracleRuntime.setMaxMemorySize(2 * OracleRuntime.getMaxMemorySize());
57+
System.out.println("New MaxMemsize: " + OracleRuntime.getMaxMemorySize());
58+
59+
System.out.println("Old JavaStackSize(): "
60+
+ OracleRuntime.getJavaStackSize());
61+
OracleRuntime.setJavaStackSize(2 * OracleRuntime.getJavaStackSize());
62+
System.out.println("New JavaStackSize(): "
63+
+ OracleRuntime.getJavaStackSize());
64+
65+
System.out.println("Old ThreadStackSize(): "
66+
+ OracleRuntime.getThreadStackSize());
67+
OracleRuntime.setThreadStackSize(2 * OracleRuntime.getThreadStackSize());
68+
System.out.println("New ThreadStackSize(): "
69+
+ OracleRuntime.getThreadStackSize());
70+
}
71+
}
72+
/
73+
show errors;
74+
75+
create or replace procedure memtests
76+
as language java name
77+
'memtest.Tests()';
78+
/
79+
80+
show errors;
81+
82+
set serveroutput on
83+
Call dbms_java.set_output(50000);
84+
call memtests();

0 commit comments

Comments
 (0)