Memory leakage problem
Posted on 2005-05-11
We are having a C++ converter which converts messages into a specific format based on the input.
The problem is whenever this program is called with large number of records, it is taking up huge memory ( > 500 MB) and later on crashes.
There is no issue if the input data is less.
I've identified some point in the code where it might go wrong, can anyone pls help in this issue ---
CONVERTER_OBJS* pGConvObjs = new CONVERTER_OBJS();
Msg(szCallerID, "Create Context structure failed");
memset(pGConvObjs, 0, sizeof(CONVERTER_OBJS));
iRet = SetTemplate(pGConvObjs);
In SetTemplate function, the error is being thrown when trying to load dynamic libraries.
In header file, we have defined --
Is there any problem, in initializing the memory with the above memset(),
or should it be done like this ---
memset(pGConvObjs, '\0', sizeof(pGConvObjs));