Re: Efficient hashmap serialization?



Sn0tters@xxxxxxxxxxx wrote:

> I serialize this map to send it over RMI, but it seems quite slow.

I'm not sure how RMI interacts with serialisation, but I suspect that there may
be a problem here.

As jan V says, within any given serialised stream, objects are only represented
once, even if they are part of a complicated object network. However, this may
not be the case when you are using RMI, unless you are driving it in such a way
that RMI can "see" that it is getting several references to the same object in
different requests. As I say, I'm not clear on exactly how RMI manages such
things, so I could be completely wrong, but it sounds as if what may be
happening is that your entire object-network is being serialised on every
request. If that's the case then it should be easy enough to diagnose (fixing
it is different ;-) since each RMI request would generate network traffic
(easily visible with any handy network monitor) that is of the same order of
size as your datastructure when serialised out to disk.

Incidentally, even if I am guessing wrong here, I think that it would be a good
idea to try serialising your data to file before worrying about RMI. If that's
slow too, then RMI isn't the problem and can be ignored while you focus on the
serialisation alone.

-- chris



.



Relevant Pages

  • Re: Efficient hashmap serialization?
    ... >> I'm not sure how RMI interacts with serialisation, but I suspect that ... RMI doesn't keep ObjectOutputStreams around across remote ... object graph in small steps. ...
    (comp.lang.java.programmer)
  • RMI and Threads
    ... - the Web Service method invokes a method of a RMI Server, ... of System.out I realized that only "RMI TCP Connection" and "RMI TCP ... Isn't it supposed that each RMI request generates a new thread (if existing ...
    (comp.lang.java.help)
  • Re: Name of class instance
    ... For a long right run it is not instance business to handle RMI (Remote ... request to the dispatcher with reference to itself as request ... hold a reference to the object which is the proper way to do things. ...
    (comp.lang.javascript)
  • Re: Auto Updating an App
    ... way to update the Jar file? ... With RMI you can update existing classes or load new classes across a ... Basically it is very easy if you can guarantee a network ...
    (comp.lang.java.help)