I had a 7*24 OCI app which memory keeps growing. I am currently debug it and find there is a table that I created using
retStatus = OCIObjectNew(m_pOCIEnv, m_pOCIError, m_pOCISvcCtx, OCI_TYPECODE_TABLE,
(OCIType *)param.b_pvType, (void *)0, OCI_DURATION_DEFAULT, TRUE, (void **)¶m.b_pvValue);
and I puts lots of Type object into this collection.
And when I delete the table, I used the following function:
retStatus = OCIObjectFree(m_pOCIEnv, m_pOCIError, param.b_pvValue, OCI_TYPECODE_TABLE);
I thought the collection takes a continieous memory which can be freeed by the above statement.
Do I neet to delete each item before calling the OCIObjectFree as follows?
retStatus = OCITableDelete(m_pOCIEnv, m_pOCIError, i, (OCITable *)param.b_pvValue); // i is the index of the item.
You need to delete each one of them to make for better cleanup of memory to FREE() to OS.
Eventhough depending on OS architecture memory may not be released , however should NOT increase. Increase in memory is due not enough cleanup on allocations.