Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Scala pickle cannot handle classes with cyclic references #1

Closed
markehammons opened this issue Jun 18, 2013 · 3 comments
Closed

Scala pickle cannot handle classes with cyclic references #1

markehammons opened this issue Jun 18, 2013 · 3 comments
Milestone

Comments

@markehammons
Copy link

import scala.pickling._
import json._

object Test extends App {
        val x = (new X).pickle
        println(x)
        x.unpickle[X]
}


class X {
        var y = new Y(this)
}


class Y(val x: X) {}

The above class will cause an out of memory error.

@heathermiller
Copy link
Member

Good catch! This is a known limitation, that we're currently working to resolve. We've actually got a hard, non-negotiable deadline to resolve this within the month. So stay tuned– we've got a solution for this in the works.

@phaller
Copy link
Contributor

phaller commented Jul 29, 2013

FYI, this has been resolved in the "oopsla2013" branch:
https://github.com/scala/pickling/tree/oopsla2013

This will be integrated into the main branches soon.

@heathermiller
Copy link
Member

All of this is now in the main 2.10.x branch, so marking as fixed :)

(Our OOPSLA paper was updated with details regarding this, in the event that you're interested in the nitty gritty: Instant Pickles: Generating Object-Oriented Pickler Combinators for Fast and Extensible Serialization)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants