Skip to content

OOME / children of class {enum} were already queried before value {case} was discovered #9064

Closed
@letalvoj

Description

@letalvoj

In letalvoj/loonyssh/tree/bug-report I am getting either

[error] 216 |    case `cast128-cbc`
[error]     |          ^
[error]     |children of class EncryptionAlgorithm were already queried before value cast128-cbc was discovered.
[error]     |As a remedy, you could move value cast128-cbc on the same nesting level as class EncryptionAlgorithm.

or java.lang.OutOfMemoryError.
The EncryptionAlgorithm is an enum and cast128-cbc is one of it's cases. It is used inside a case of yet another enum SSHMsg

The proposed remedy is not helpful much, since I can hardly do anything with nesting of the values in the enum.

I tried to minimize the example but it did not work.

Beware! Once the build passes due to some changes in code (like commenting out the cause) it continues to pass long even when it should not due to incremental compilation. It is enough to run ;clean;compile and the build starts failing again.

Implicits involved in children of ...

The following chain of givens is involved when the issue emerges:

Funny enough - if the NameList[EncryptionAlgorithm] is not nested inside SSHMsg.KexInit then the 2nd summon[SSHReader[NameList[EncryptionAlgorithm]]] compiles just fine.

Attempted fixes

  • @smarter proposed to move the EncryptionAlgorithm to the same file where SSHMsg.KexInit, which did not help
  • letalvoj/loonyssh/tree/bug-report-oome moving enums and other data structures to a separate module fixes the isue but it hangs the compilation. After several minutes I get
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "classloader-cache-cleanup-0"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "task-progress-report-thread"

Profiling the compilation in the case of java.lang.OutOfMemoryError

Those are the objects which eat all the memory:
Screenshot 2020-05-28 at 09 41 42

This seems to be the thread which produces them:
Screenshot 2020-05-28 at 09 42 00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions