Skip to content

shlomif/euler685-python3-solution-high-ram-consumption

Repository files navigation

About

This a demo repository for a problem I am having with cpython3 and pypy3 where the program consumes a lot of RAM quickly on Fedora 31.

It is a work-in-progress solution to this project euler challenge.

Update: A Solution was Found

Upon further investigation, using tracemalloc turned out to be good enough. Thanks to everyone who helped.

To reproduce

Run gmake run.

How much is "high RAM consumption"?

You can find a screenshot of htop, and a similar text transcript of the terminal, where it shows it consumes over 1-2 GB of RAM well before reaching k=1,000 (out of max k=10,000).

Attempts to fix:

I tried using https://pypi.org/project/memory-profiler/ but it slowed down the code and did not display a significant memory increment.

I tried using https://docs.python.org/3/library/tracemalloc.html but its reported allocations were small.

Releases

No releases published

Packages

No packages published