When the stored proc returned an Array of Clobs, the code was only directly free'ing the Array, and not the underlying Clob objects as well.
Adding a call to free
on the Clob object eliminated the performance degradation.
I assume that when the Clob object is garbage collected, free
is intrinsically called in finalize
, but I suspect that the Oracle Connection object holds a reference to any Clob objects used, thus keeping it from being garbage collected. Silly miss on my part, but hopefully this will help someone from getting tripped up in the future.
Array return_objs = ocs.getArray(1);
Clob[] clobs = (Clob[]) return_objs.getArray();
return_objs.free();
for(int i = 0; i < clobs.length; i++ )
{
//Utilize clob
clobs[i].free();
}