I am looking into integrating a JRE into a C++ application via JNI.
What is the overhead of holding a large number of references to Java objects within the C++ application (global references in JNI parlance)?
Are there any problems I should be aware of with this approach (other than the obvious, such as manually deallocating the references)?
(a) the overhead is the same as if you were doing it from Java. You are preventing the objects from being garbage-collected.
(b) Holding object references across JNI calls can be fatal to the JVM unless you do it correctly. You need to read carefully the section on Global and Local References in the JNI specification. You also need to consider using Weak References instead of global ones.