Zulip Chat Archive

Stream: new members

Topic: Excessive memory consumption


Haruhisa Enomoto (May 10 2022 at 09:38):

I'm working on a git branch of mathlib. After I eddited an existing file (algebra/group/units.lean), I opened my own lean file, and lean didn't respond and said the following error at import part:
"invalid import: data.option.defs
excessive memory consumption detected at 'expression traversal' (potential solution: increase memory consumption threshold)"
How should I do?
What I did is: restart VS code and Lean, commit changes and execute leanproject mk-cache and leanproject get-cache in git bash.

Eric Wieser (May 10 2022 at 09:47):

leanproject mk-cache just saves the files you currently have compiled

Eric Wieser (May 10 2022 at 09:48):

When you run get-cache does it say "fetching remote oleans" or "using local oleans"

Haruhisa Enomoto (May 10 2022 at 09:50):

It says:

$ leanproject get-cache
Looking for mathlib oleans for 25a62a84e1
  locally...
  Found local mathlib oleans
Using matching cache
Applying cache
  files extracted: 2421 [01:03, 37.92/s]

so probably it used local oleans.

Haruhisa Enomoto (May 10 2022 at 09:52):

Should I use leanproject build?

Eric Wieser (May 10 2022 at 09:57):

You've poisoned your cache with useless oleans

Eric Wieser (May 10 2022 at 09:57):

leanproject build would create new ones, but will take a long time

Eric Wieser (May 10 2022 at 09:58):

Have you pushed your changes to github at all? If so, then it can build you a better cache (without using your CPU time and electricity!)

Eric Wieser (May 10 2022 at 10:00):

@Patrick Massot, should mk-cache give a warning / overridable error if the oleans are out of date? Is "out of date oleans" something we can actually detect right now?

Haruhisa Enomoto (May 10 2022 at 10:52):

Thanks, so I shouldn't have usedleanproject mk-cache.
Now I pushed it to github, so what should I do next?

Haruhisa Enomoto (May 10 2022 at 11:33):

I used leanproject --force-download get-cache, and problem went away! Thanks!

Eric Wieser (May 10 2022 at 13:25):

I forgot that option existed; indeed, that's exactly the right solution

Eric Wieser (May 10 2022 at 13:26):

mk-cache is mainly useful for if you started a local build, but then decide to switch branch to work on something else. When you reload the cache, you'll be able to resume your build where you left off

Eric Wieser (May 10 2022 at 13:27):

Local builds are often useful if you edit really_basic_file.lean and run lean --make mostly_basic_file.lean; rather than pushing to github and waiting an hour or two for it to build everything

Jireh Loreaux (May 10 2022 at 13:46):

Just for future reference, you could always just delete the poisoned cache directly. On Linux they are stored in ~/.mathlib. I'm not sure where they are on another OS.

Patrick Massot (May 10 2022 at 16:36):

Eric Wieser said:

Patrick Massot, should mk-cache give a warning / overridable error if the oleans are out of date? Is "out of date oleans" something we can actually detect right now?

I never use this command myself. I'm open to any modification.

Haruhisa Enomoto (May 15 2022 at 10:32):

What's the usual way when modifying many imported files?
I modified such a file again, and I run lean --make for it, but lean was very slow and I had to commit and push it to github and wait.
Is this a usual case?

Ruben Van de Velde (May 15 2022 at 10:34):

If you change files that many other files depend on, yeah, that's common

Haruhisa Enomoto (May 15 2022 at 11:33):

OK, I didn't know that, thanks!

Andrew Helwer (May 18 2022 at 21:58):

I just installed lean and mathlib from the vs code extension, and get the same error when opening 00_first_proofs.lean in the tutorials directory; it runs for a while then times out. The leanproject binary doesn't seem to be included in .elan/bin so I can't download a cache.

Patrick Massot (May 18 2022 at 22:04):

You need to follow installation instructions from https://leanprover-community.github.io/get_started.html#regular-install if you want the full tooling

Andrew Helwer (May 18 2022 at 22:05):

(deleted)


Last updated: Dec 20 2023 at 11:08 UTC