We upgraded to a new version of Oracle and because of that we had to upgrade our JDBC driver from ojdbc14.jar (1.4) to ojdbc8.jar. we are now getting this error below. IBM is saying we need to use the 64 bit ojdbc8.jar. Any thoughts?
From IBM
we are running java 8 32 bit JVM and specifying a maximum heap of 2GB. they recommend we switch to 8 64 bit driver and increase heap to 4GB.
they also say this is Oracle's problem which I find hard to believe since we are using JAVA on the AS400.
Error:
JVMDUMP039I Processing dump event "systhrow", detail "java/lang/OutOfMemoryError" at 2023/05/16 03:24:57 - please wait.
java/lang/OutOfMemoryError
-
- Site Admin
- Posts: 782
- Joined: Sun Jul 04, 2021 5:12 am
Re: java/lang/OutOfMemoryError
Not the 64-bit jar.... the 64-bit Java runtime... (The jar is the same in either case.)
The 64-bit environment supports much more memory because 32-bit addresses can only address up to 4gb of memory maximum, whereas 64-bit addresses can support nearly 2 exabytes.
The 64-bit environment supports much more memory because 32-bit addresses can only address up to 4gb of memory maximum, whereas 64-bit addresses can support nearly 2 exabytes.
Re: java/lang/OutOfMemoryError
Thank you , worked.
Re: java/lang/OutOfMemoryError
Sorry Scott, when I said it worked that was in test but when I placed the code in production it failed on the same error OutOfMemory. This is what I placed in my CL before I call the RPG
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit') REPLACE(*YES)
ADDENVVAR ENVVAR(CLASSPATH) VALUE('/java/jdbc/ojdbc8.jar') REPLACE(*YES)
call RPG
is this correct or what am I missing?
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit') REPLACE(*YES)
ADDENVVAR ENVVAR(CLASSPATH) VALUE('/java/jdbc/ojdbc8.jar') REPLACE(*YES)
call RPG
is this correct or what am I missing?
-
- Site Admin
- Posts: 782
- Joined: Sun Jul 04, 2021 5:12 am
Re: java/lang/OutOfMemoryError
You can try increasing the amount of memory that's available to Java to see if that helps.
From a PASE command line, type the following:
On my system, it prints this:
What this tells me is the most memory that Java will allow is 2gb on my system (unless I tell it otherwise.) Based on that I might decide to tell it to allow more memory.
For example, I could define:
This sets the initial heap size to 4gb (4096 mb) and the maximum to 6gb (6144 mb). This needs to be done before the JVM is loaded in the job (the same as the the CLASSPATH and JAVA_HOME).
I don't know if this will help (it strikes me as very strange that 2gb isn't enough... but maybe your Java settings are different) but please bear in mind that none of this has anything to do with my code -- it is basic Java setup. And it is the Oracle driver that is using the memory, not my programs... so I'm not really an expert, here.
At any rate, it's worth a try.
From a PASE command line, type the following:
Code: Select all
java -XX:+PrintFlagsFinal -version | grep HeapSize
Code: Select all
size_t MaxHeapSize = 2147483648
For example, I could define:
Code: Select all
ADDENVVAR ENVVAR(QIBM_RPG_JAVA_PROPERTIES) VALUE('-Xms4096M;-Xmx6144M;')
I don't know if this will help (it strikes me as very strange that 2gb isn't enough... but maybe your Java settings are different) but please bear in mind that none of this has anything to do with my code -- it is basic Java setup. And it is the Oracle driver that is using the memory, not my programs... so I'm not really an expert, here.
At any rate, it's worth a try.
Re: java/lang/OutOfMemoryError
thank you Scott, I will try this tonight.
Re: java/lang/OutOfMemoryError
Scott, you suggestion below worked to increase the heap size. Thank you for all your help.
ADDENVVAR ENVVAR(QIBM_RPG_JAVA_PROPERTIES) VALUE('-Xms4096M;-Xmx6144M;')
ADDENVVAR ENVVAR(QIBM_RPG_JAVA_PROPERTIES) VALUE('-Xms4096M;-Xmx6144M;')