-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Out of memory error compiling macro example #7618
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
Comments
How much ram do you have ? Have you tried forcing sbt to use a specific amount ? (Run |
I have 16gb RAM. I don't know how much sbt uses by default but increasing it to 2GB as you suggested yields a useful stack trace: |
It is probably the use of |
The out of memory is happening because there is a missing inline def compile(e: Exp, env: Map[String, Expr[Int]])(given ctx: QuoteContext): Expr[Int] = inline e match { this implies that when the pattern does not match, the full pattern is kept and all branches trigger new inlines. Therefore inlining an exponentially amount of irreducible inlines each turn. |
…-context Fix #7618: Remove QuoteContext.macroContext
environment
OS:
Linux 5.0.0-36-generic / Ubuntu 19.04
anddebian 9 (stretch)
Java:
11.0.5
SBT:
1.3.4
Dotty:
0.20.0-RC1
minimized code
The code is mostly taken from the documentation about macros.
the problem
I have the code in a SBT project created using the g8 template. Trying to compile the code results in the the compiler getting stuck and running out of memory. The process never finishes. I have to kill it.
Obviously I have not the slightest idea what I'm doing with regard to macros but either way I think the compiler should be able to handle it.
reproduction
If you happen to have docker installed you should be able to reproduce the issue with this one line:
The text was updated successfully, but these errors were encountered: