I am developing a logger / sniffer using Delphi. During operation, I get hugh amounts of data that can accumulate during stressful operations up to about 3 GB of data. On some computers, when we get to these levels, the application stops functioning and sometimes throws exceptions.
I am currently using the GetMem function to place a pointer to each message.
Is there a better way to allocate memory so that I can minimize the chance of failure? Keep in mind that I cannot limit the size to a hard limit.
What do you think about using HeapAlloc, VirtualAlloc, or perhaps even mapped files? What would be better?
Thank.
source
share