The question is heavily under-documented, but I can reverse-engineer some of it. First off, the only way you can run out of memory is when you use a list of structures instead of classes. That makes a structure size 4 * 5 = 20 bytes. At 16.5 million elements, you'll need an internal array for the List<> that has at least 20 x 16.5 = 330 megabyte of contiguous virtual memory. The next allocation will ask for double the size, 660 megabytes. That's hard to come by in a 32-bit process. The risk of OOM is very close with that size.
At issue is that you need a continguous allocation. In other words, a unused hole in the virtual memory address space that is at least 660 megabytes. The trouble is that the VM space needs to be shared by both code and data. And code is the usual troublemaker here. A DLL that gets loaded on one machine but not the other. Like the shovelware from Intel, the vendor or a virus scanner. A DLL has a preferred load address that can be very awkward, splitting the available address space into two smaller parts. The sum of the parts still plenty large enough but not leaving a big enough hole to fit a 660 MB allocation.
This is a general problem called "address space fragmentation". It is always the first cause of OOM, it is very hard to consume all 2 gigabytes of available address space. That could only happen by making very small allocations.
Several very simple things you can do to fix this problem:
- Get rid of the shovelware on that machine, use SysInternals' VMMap utility to see if that worked
- Use a class instead of a structure. Now the List element size is only 4 bytes instead of 20
- Use the List<>.Capacity property. This can reduce the address space fragmentation you get from having the internal array reallocated several times while the list grows. As long as you have a good initial guess.
- You've got nice hardware, use it. Change the Target platform setting on the EXE project to AnyCPU. A 64-bit process has massive amounts of address space, very hard to consume it all.
- You can run Editbin.exe with the /LARGEADDRESSAWARE option on your EXE. Now your 32-bit process will have a 4 gigabyte address space on a 64-bit operating system.