Question

I try to run nvvp for profiling cuda code in command line

nvvp ./my_app

But ,I get following error

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine. 

I understand problem is with java not able to allocate sufficient heap to run the app. Based on what I read about this issue in SO (and else where in internet) I try following

java -Xmx128m nvvp ./myapp

It doesn't solve my problem and I get following message

Exception in thread "main" java.lang.NoClassDefFoundError: nvvp
Caused by: java.lang.ClassNotFoundException: nvvp
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
Could not find the main class: nvvp. Program will exit.
Was it helpful?

Solution

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.

OTHER TIPS

This message says that JVM was not able to allocate enough memory for the heap from OS, -Xmx/-Xms will not help in this case.

Please answer the questions I posted in a comment so we could find what is causing this problem...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top