-
Notifications
You must be signed in to change notification settings - Fork 21
OutOfMemoryError in patmat on 2.11.0 #8531
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
Imported From: https://issues.scala-lang.org/browse/SI-8531?orig=1
|
@retronym said: What is the minimum memory needed to compile? Does, say, 1.2G work? It would be good to track this down to a smaller test case. A blackbox way to do this: SOURCES=$(find src -name '*.scala')
CP=foo.jar:bar.jar
echo jointly compiling everthing with copious memory
scalac J-Xmx4G -d target/classes -classpath $CP ... $SOURCES
for s in $SOURCES; do
echo individually compiling $s with limited memory
scalac J-Xmx500M -classpath target/classes:$CP $s
done Looking at your heap dump, it looks like the OOME was triggered during: antigone\src\gsa\antigone\angkor\transmission.scala But that's not 100% reliable, something could have leaked before then and that file was just the straw that broke the camel's back. Can you also please try compiling with |
@retronym said: |
@retronym said: |
@retronym said: |
@oxbowlakes said: I don't know whether what you've identified would reveal the expected behaviour. Basically, most of our codebases seem to be trivially migratable and the compile times have not noticeably changed. But some have gone thru the roof - so it feels like some exponential problem in the patmat phase. I can get the source to compile here with a 3Gb heap Chris |
@retronym said: |
@oxbowlakes said: I've looked at the file you suggested and there is nothing obvious in there (I've tried constructing a minimal case). The construction of the project means that there are a lot of packages with very similar, but not identical code :-s When I've some spare time next week, I will strip out the packages other than "common" and add them one by one to hopefully narrow it down |
@retronym said: But you can also enable |
@oxbowlakes said: |
@retronym said: I suspect that you could workaround the problem by changing: val x: LargeEnum = ...
x match { case V1 => ;case V2; ... }
// will disable the analysis for exhaustiveness
(x: Any) match { case V1 => ;case V2; ... } |
@oxbowlakes said (edited on May 7, 2014 10:15:45 AM UTC): WriteEnum.scala - if you compile & run this, it will generate a file C:/tmp/SI8531/foobar/MyEnum.java (I've attached this file) Open a command prompt on C:/tmp/SI8531 and run the following: C:\tmp\SI8531>javac foobar\MyEnum.java (I've attached foobar.jar so you can skip this step) Now try and compile SI8531.scala with foobar.jar on the classpath - it takes ages. (Equivalently, you can skip the creation of the JAR and just compile SI8531 with the directory C:/tmp/SI8531 on the classpath) |
@retronym said (edited on May 8, 2014 2:30:02 PM UTC): The OOME appeared after: scala/scala@69557da
|
@retronym said: New PR that includes the test: scala/scala#3727 |
@oxbowlakes said (edited on May 15, 2015 4:01:39 PM UTC): |
@retronym said: We have a performance fix for the pattern matcher merged in preparation for 2.11.7. scala/scala#4379 Would you be able to retest with 2.11.7-SNAPSHOT? |
@retronym said: |
We have a codebase, called "antigone" which is caused the patmat phase of compilation to throw an OutOfMemoryError when compiled with -Xmx2g, where previously it would compile just fine with -Xmx700m (I have had to make no code changes as part of the upgrade).
I am privately sending Jason a heap dump from the profiler
The text was updated successfully, but these errors were encountered: