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

SI-3809 Avoid cycles during classfile parsing #5308

Closed
wants to merge 2 commits into from

Conversation

retronym
Copy link
Member

@retronym retronym commented Jul 28, 2016

Manually tested with:

scalaHome := Some(file("/code/scala/build/pack"))
libraryDependencies += "com.datastax.cassandra" % "dse-driver" % "1.0.0"
class Test {
  new com.datastax.driver.dse.DseCluster.Builder()
}

I was also able to compile pos/cycle{-jsoup,} without the experimental
-Ybreak-cycles. I've removed the entire -Ybreak-cycles option and
supporting code in favour of the approach in this patch.

What's changed? I've used lazy types for methods infos, which is analagous
to what we do in Unpickler for scala originated types.

@retronym
Copy link
Member Author

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 123207680 bytes for committing reserved memory.
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32 bit mode, the process size limit was hit
# Possible solutions:

@retronym retronym changed the title WIP SI-3809 Avoid cycles during classfile parsing WIP SI-3809 Avoid cycles during classfile parsing [ci: lastOnly] Jul 28, 2016
@retronym
Copy link
Member Author

/rebuild

@retronym retronym force-pushed the ticket/3809 branch 2 times, most recently from 32b803c to b1c90e0 Compare July 28, 2016 12:22
@retronym retronym changed the title WIP SI-3809 Avoid cycles during classfile parsing [ci: lastOnly] WIP SI-3809 Avoid cycles during classfile parsing [ci: last-only] Jul 28, 2016
@retronym retronym added this to the 2.12.1 milestone Jul 28, 2016
@retronym retronym self-assigned this Jul 28, 2016
@SethTisue SethTisue added the WIP label Nov 10, 2016
@retronym retronym modified the milestones: 2.12.2, 2.12.1 Nov 15, 2016
@retronym retronym force-pushed the ticket/3809 branch 6 times, most recently from 2061985 to 736765a Compare November 21, 2016 13:29
Manually tested with:

```
scalaHome := Some(file("/code/scala/build/pack"))
libraryDependencies += "com.datastax.cassandra" % "dse-driver" % "1.0.0"
```

```
class Test {
  new com.datastax.driver.dse.DseCluster.Builder()
}
```

I was also able to compile `pos/cycle{-jsoup,}` without the experimental
`-Ybreak-cycles`. I've removed the entire `-Ybreak-cycles` option and
supporting code in favour of the approach in this patch.

What's changed? I've used lazy types for methods infos, which is analagous
to what we do in `Unpickler` for scala originated types.
@retronym retronym changed the title WIP SI-3809 Avoid cycles during classfile parsing [ci: last-only] SI-3809 Avoid cycles during classfile parsing [ci: last-only] Nov 29, 2016
@retronym retronym removed the WIP label Nov 29, 2016
@retronym retronym assigned adriaanm and unassigned retronym Nov 29, 2016
@retronym retronym changed the title SI-3809 Avoid cycles during classfile parsing [ci: last-only] SI-3809 Avoid cycles during classfile parsing Nov 29, 2016
@retronym retronym added the WIP label Dec 11, 2016
@retronym
Copy link
Member Author

retronym commented Dec 11, 2016

I've realized that the addition of laziness here will increase the footprint: the ConstantPool, which we access in the type completer, references $outer.in.buf, the entire contents of the class file.

I've just pushed a WIP commit to might alleviate this problem.

@Swoorup
Copy link

Swoorup commented Aug 9, 2020

This is also occuring on dotty. scala/scala3#9492
Any ideas how to port the fix over? @retronym

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

Successfully merging this pull request may close these issues.

4 participants