I'm aware of the fact that you can dump the local reference table using the method illustrated here.
jclass vm_class = env->FindClass("dalvik/system/VMDebug");
jmethodID dump_mid = env->GetStaticMethodID( vm_class, "dumpReferenceTables", "()V" );
env->CallStaticVoidMethod( vm_class, dump_mid );
However, this prints it to the log.
I'm wondering if there is a way to retrieve the current number of local references at any given moment in time programmatically.