From: Joel VanderWerf Date: 2008-05-22T10:26:02+09:00 Subject: Re: custom serialization problem 2 (marshal_dump, marshal_lo sayoyo Sayoyo wrote: > Hi, > > I'm using ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux] and > Rails 1.2.5 > > The problem I have, is the class XXX should have an array of YYY as > data, but it turn out I got only NIL when I deserialized, then I got an > exception for unable to use [] for a NIL. It happens only when I have a > lot of data. > > The example I posted here is an simplification of my data, actually I > have 5 classes, the structure: > A-- > |-Array of B > |- C > > B-- > |-Array of D > > C-- > |-Array of E > > and each of them have more and less 10 attributes... When I have 5000 of > B, the serialized file has almost 1 meg. And I also realized each time I > serialized the same data, the file got a different size each time... > > How can I verify the serailization? I would try to come up with a minimal characterization of the problem--minimize the classes, attrs, objects so that if you take away anything else the problem goes away. That should help point to the problem. Also, you could try running this on other systems and ruby versions.... -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407