Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process finished with exit code -1073741819 (0xC0000005) #5

Open
brubsby opened this issue Dec 20, 2022 · 1 comment
Open

Process finished with exit code -1073741819 (0xC0000005) #5

brubsby opened this issue Dec 20, 2022 · 1 comment

Comments

@brubsby
Copy link

brubsby commented Dec 20, 2022

When generating primes up to 1e12, the process exits with an unusual error code. I imagine it's due to my system not having enough memory, but I thought primesieve might be able to deal with this situation.

pyprimesieve.primes(5245028923, int(1e12))

pyprimesieve immediately sends this code, which I can't really make sense of after a cursory glance at the source of this library and primesieve. It would be nice to know what's going on, but I fear I'll have to use primesieve itself to debug the error as it is now.

@JoshWarn
Copy link

Similar error with the following snippet:
pyprimesieve.primes(4, 5)
It checks numbers between start to end-1, so in this case only 4. As 4 is composite, there aren't any primes there.
Instead, it returns an' array of [<NULL>, <NULL>].
Currently detecting via the following; though it's not good code.
primes = pyprimesieve.primes(4, 5)
if "<NULL>" in str(primes):
print("No Primes.")
else:
print("Are Primes.")

In your case, however, it's likely you're running out of RAM.
Primes from 5_245_028_923 to 20_000_000_000 take ~25.4 GB of RAM.
I'm not familiar regarding the RAM utilization trend, but very optimistically assuming linear (probably very inaccurate), 1e^12 would need ~1,712 GB. And that's optimistic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants