Memory Size and Function | Vantage BYOM - JVM Memory Size and JVMMemStats Function - Teradata Vantage

Teradata Vantageā„¢ - Bring Your Own Model User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Teradata Vantage
Release Number
5.0
Published
October 2023
Language
English (United States)
Last Update
2024-04-06
dita:mapPath
fee1607120608274.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
fee1607120608274

When a Vantage BYOM query runs, the model is loaded into Java Virtual Machine (JVM) memory.

To check if the JVM has enough memory for your model or models, run the JVMMemStats function included in the Vantage BYOM package. JVMMemStats is a Java UDF that returns the amount of JVM memory in several categories on each node:

Column Description
Node ID Node identifier.
Free Memory KB of JVM memory available for new objects on this node.
Used Memory KB of JVM memory used by instantiated objects on this node.
Total Memory KB of total JVM memory on this node (Free Memory on this node plus Used Memory on this node).
Max Memory Maximum KB of memory allocated for JVM (-Xmx value) on this node.
Unalloc Memory KB of memory designated for new objects on this node but not yet allocated (Max Memory minus Total Memory).

Example:

SELECT DISTINCT * FROM mldb.JVMMemStats() AS dt
 *** Query completed. 2 rows found. 6 columns returned. 
 *** Total elapsed time was 1 second.

Node ID  Free Memory (KB)  Total Memory (KB)  Used Memory (KB)  Max Memory (KB)  Unalloc Memory (KB)
-------  ----------------  -----------------  ----------------  ---------------  -------------------
55       4267470           4589568            322098            7456768          2867200
56       3899147           4589056            689909            7456768          2867712

The model must be loaded in each node. If the total free memory ("Free Memory" plus "Unalloc Memory") on any node does not have enough space for your PMML model or models, you can change the minimum and maximum sizes of JVM memory with the -Xms and -Xmx options of the CufConfig parameter JVMOptions. These option changes apply to JVM memory on every node.

For example, this line sets the initial allocation of JVM memory specified by Xms to 2 GB (2048 MB) out of the maximum memory pool of 8 GB (8192 MB) specified by Xmx, in every node:
JVMOptions: -Xms2048m -Xmx8192m

The recommended minimum value for the JVM memory is 8GB.

Increasing JVM memory may impact other workloads that need memory now allocated to JVM.