According to many SO answers and this widely cited blog post, a .NET 4.5 application built for 'Any CPU' with the 'prefer 32-bit' option selected will run as a 32-bit process on both 32-bit and 64-bit systems (unlike in .NET 4.0 and earlier). In other words, x86 and AnyCPU with 'prefer 32-bit' selected are equivalent (ignoring whether or not it can run on ARM).
However, my tests have shown that on a 64-bit system an 'AnyCPU prefer 32-bit' application (which I confirm runs 32-bit) can allocate more memory than an x86 one. I wrote a .NET 4.5 C# console app that allocates 10MB byte arrays in a loop (keeping the references of course) until it hits an OutOfMemoryException, and ran it on a 64-bit system with plenty of RAM. When built as x86 it falls over at about 1.2GB allocated. The same code built as 'Any CPU (prefer 32-bit)' gets up to 1.5GB.
Why the difference?
gcAllowVeryLargeObjects
and try. My guess is you triggerList
resizing its internal array and resizes into an "OOM" – Mohenjodaro