[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: basemap loaded + displayed



Yeah -- you can override the writeObject(ObjectOutputStream oos) and
readObject(ObjectOutputStream) methods in a class. The bad news is that this
doesn't fix the problem - if you just dump state (including portals, which are
themselves serializable, etc) to the stream, the same issue happens. The
solution is to fix the representation internally.

The bad news is that there isn't a way to lazily evaluate neighbors over RMI as
far as I know. Locally, of course, this isn't a problem.

-P

Quoting Michael Craig <mic@graphics.csail.mit.edu>:

> 
> doesn't java let you override the default serialize() method?
> 
> On Wed, 21 Jan 2004, Patrick Nichols wrote:
> 
> > All --
> >
> > Hit some serious issues today actually displaying the entire basemap +
> > route maps, mostly derived from Java serialization issues. I've attached
> > an image of the basemap loaded and displayed in a java applet after being
> > recursively obtained over RMI - basic b&w for now, will look pretty soon
> > (I promise). This at least shows you what the contours look like.
> >
> > Java RMI note: it turns out that when Java serializes objects, every
> > non-transient field of the serialized object is *also* serialized. If a
> > Space is serialized, and it has a set of Portals ... which each have a
> > pair of Spaces ... which each have a set of Portals ... well, serializing
> > a single object requires that the entire graph state be serialized, which
> > is bad. This didn't show up for a single loaded building, or even a large
> > number of unconnected buildings (remember - the entire connected graph
> > only gets serialized, not the entire thing). Java has a hard cap of 15MB
> > of serializable state over RMI, causing horrible EOF errors if you try to
> > send a huge object over RMI.
> >
> > Lesson learned: use the transient keyword early and often when writing
> > Java RMI code.
> >
> > --
> > * * *
> >
> > Patrick James Nichols II
> > Graduate Student, MIT Computer Graphics Group
> > http://graphics.csail.mit.edu/~pnichols
> >
>