We are using RTD Win32 SDK to fetch skill set statistics. We are facing a memory leak in the NIrtd_singleDataRequest call. I have described the problem below. Has anyone faced the same issue? The AACC version is 6.4.16 (SP16) . Is this a known issue and was fixed in a later release?
Problem Description: Memory leak detected in the NIrtd_singleDataRequest call
The function NIrtd_singleDataRequest seems to allocate two Table Group object as per the NIrtd_getCnt. We could free only one object using NIrtd_freeTableGroup. In the following code snippet, we are displaying the counts before and after the NIrtd_singleDataRequest function call. The output of the code also given below.
As seen, the TGCnt before the call is 0 and after the call is 2. However, after calling the NIrtd_freeTableGroup function, only one TG object is freed and the another remain unallocated thereby leaking memory.
========================= Code Snippet
=========================
void zDisplayDebugCount(const char *dispStr)
{
printf("================================ \n");
printf(" --- %s --- \n", dispStr);
printf("================================ \n");
printf("Query Count %d \n", NIrtd_getCnt(QueryCnt));
printf("Conj Count %d \n", NIrtd_getCnt(ConjCnt));
printf("TG Count %d \n", NIrtd_getCnt(TGCnt));
printf("Row Count %d \n", NIrtd_getCnt(RowCnt));
printf("Value Count %d \n", NIrtd_getCnt(ValueCnt));
printf("Cache Count %d \n", NIrtd_getCnt(CacheCnt));
printf("Name Count %d \n", NIrtd_getCnt(NameCnt));
return;
}
void main()
{
/* Some code is removed for brevity */
/* --------------------------------------
** Call API
** ------------------------------------
*/
zDisplayDebugCount("Before NIrtd_singleDataRequest Call");
*RetCode = NIrtd_singleDataRequest(&tableGroup, &authPtr,&query);
zDisplayDebugCount("After NIrtd_singleDataRequest Call");
NIrtd_freeTableGroup(tableGroup);
return;
}
Output of the program:
================================
--- Before NIrtd_singleDataRequest Call ---
================================
Query Count 1
Conj Count 0 TG Count 0
Row Count 0
Value Count 291
Cache Count 2
Name Count 291
Compression was ON - data uncompressed successfully.
================================
--- After NIrtd_singleDataRequest Call ---
================================
Query Count 1
Conj Count 0 TG Count 2
Row Count 0
Value Count 291
Cache Count 2
|