What distribution method is used for a large registrar application?

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.

+5
source share
1 answer

Your main problem is limiting the hard address to 4 GB for 32-bit processes. Since you are facing 3GB problems, I can only assume that you are using /LARGEADDRESSAWARE, running on 64-bit Windows or 32-bit Windows with the / 3GB boot switch.

I think you have several options, including but not limited to the following:

  • Use less memory. Perhaps you can process smaller fragments or push part of the memory to disk.
  • Use 64-bit Delphi (just released) or FreePascal. This saves you the limitation of address space, but limits you to 64-bit versions of Windows.
  • . . .

, , , , .

, , . , , , , , . , , .

+5

All Articles