Allocation from JNI doesn't do GC?

P

Paul J. Lucas

A coworker of mine claims that if you do JNI calls in C to
allocate memory, e.g., NewShortArray(), and if there is
currently insufficient memory on the Java side, that the call
will fail without having run garbage collection, i.e., JNI
memory allocation calls never trigger garbage collection. Is
this true? If so, it seems wrong, i.e., it should trigger GC
just like an allocation in Java does. If so, why is it this
way?

- Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,085
Members
48,773
Latest member
Kaybee

Latest Threads

Top