Incremental Sieve of Eratosthenes Generator
// Unchecked because if it overflows, we don't really care, since primeCandidate would have overflowed earlier.
      unchecked { sieve[primeCandidate * primeCandidate] = primeCandidate; }



is wrong. For example, every int in the range 65537 to 80264 inclusive overflows to a value which is greater than itself.

The easy fix is to add an overflow check. That would also fix the memory problem, because sieve would have no more entries than there are primes below 65536.