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

Hitting OOM error when building large pest file #157

Closed
negator opened this issue Sep 22, 2017 · 9 comments
Closed

Hitting OOM error when building large pest file #157

negator opened this issue Sep 22, 2017 · 9 comments

Comments

@negator
Copy link

negator commented Sep 22, 2017

I have a large-ish pest file (~ 2600) lines with rules that include large numbers of alternations. When compiling this, the rustc process consumes a peak of ~35GB. I assume this has something to do with the optimization step?

Attaching the file for reference

entity.pest.zip

@dragostis
Copy link
Contributor

dragostis commented Sep 22, 2017

I've managed to compile this with less than 200MBs used by rustc. What version of Rust are you using?

@negator
Copy link
Author

negator commented Sep 22, 2017

Im compiling on a Mac:

stable-x86_64-apple-darwin (default)
rustc 1.20.0 (f3d6973f4 2017-08-27)

I've attached a sample project, including a Cargo.toml file with no optimizations. Running cargo build and examining the Acitivity Monitor, shows memory usage climb to more than 30GB.

pest_test.zip

@negator
Copy link
Author

negator commented Sep 23, 2017

Note this is compressed memory usage. Actual memory usage hits 3-4GB

@dragostis
Copy link
Contributor

dragostis commented Sep 23, 2017

cargo build ran with around 300-400MBs:

Finished dev [unoptimized + debuginfo] target(s) in 29.8 secs

UPDATE: It seems like there's a problem on stable. I'm getting OOM on stable too, but not on nightly, or beta.

@dragostis
Copy link
Contributor

I took a look over some recently closed issues in rustc, but I wasn't able to where the issue stems from. I would recommend using beta (1.21) until the 12th of October when 1.21 launches. I'll try to look into this soon.

@Victor-Savu
Copy link
Contributor

Would it make sense to report a bug on the compiler so that it is documented there as well? Especially if the problem was fixed by chance, it points to a potential regression later on.

@dragostis
Copy link
Contributor

@Victor-Savu Definitely. I've just pushed a feature not so long ago. I'll try to handle this next. (see exactly where the regression might be)

@negator
Copy link
Author

negator commented Sep 24, 2017

Looks like it was a bug in the rust compiler, rust-lang/rust#43613.

Probably isn't worth looking into further but good to note for reference.

I'Ill use nightly until rust 1.21 is released. Thanks for the quick responses!

@dragostis
Copy link
Contributor

Thanks for finding the issue. I'll close this, since the next release of Rust is due to arrive soon anyway.

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

3 participants