This is following that worked in my case
setenv _JAVA_OPTIONS "-Xms512m -Xmx1024m"
However, _JAVA_OPTIONS seemingly can have multiple names across the different systems, hence find the right one before using it. It shows following while it has picked up correct variable
nvvp ./cb_dgemm_prof
Picked up _JAVA_OPTIONS: -Xms512m -Xmx1024m
If variable is not set up properly, you might not see the line above.