Thanks for the quick answer.
It doesn't seem that the AE frees the memory it uses. When rendering a ~40 sec comp (480x360), and handling each and every one of the frames (and specifically when getting the receipt for the frame) in the comp the AE process takes approximately 1GB of physical memory (which naturally is alot). It seems that the grabbed frames are not being released properly for some reason. Only when closing the project and then AE the memory is released.
attached is the code I've written:
// get the reciept for the frame ERR(suites.RenderSuite2()->AEGP_RenderAndCheckoutFrame(roH, NULL, NULL, &receipt));
if (receipt){
AEGP_WorldH frameH = NULL;
PF_Pixel8 *pixelBase;
unsigned char *srcRow, *dstRow, *frameBase;
A_u_long rowBytes;
ERR(suites.RenderSuite2()->AEGP_GetReceiptWorld(receipt, &frameH));
ERR(suites.WorldSuite2()->AEGP_GetBaseAddr8(frameH, &pixelBase)); ERR(suites.WorldSuite2()->AEGP_GetRowBytes(frameH, &rowBytes));
// frame handling
// frame release
ERR(suites.RenderSuite2()->AEGP_CheckinFrame(receipt));
}