• Post Reply Bookmark Topic Watch Topic
  • New Topic

In-memory java object compression ...  RSS feed

 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a client/server based application in which the client sends a huge number of objects to the server to process and send the results back to the client.

The network layer is built using RMI.

I'm in the process to do some optimizations in the network layer.

One of the things i was thinking about was to compress each object on the client side before sending it to the server (the same process to be done on the server side after finishing processing on the object and just before sending back to the client).

So, is there a way to compress the object (just in memory) in Java ?

Otherwise if not, what other things do you recommend to accomplish RMI optimization ?

Please advice ...

Regards,
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a little old article but so is RMI
So, it may help you.

Usually, using externalizable instead of serializable saves some cost but sure it is a little cumbersome to maintain as you need to update your methods whenever you modify the object or add/remove fields.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also use compression on the streams:

Next you use instances of these factory classes in your UnicastRemoteObject (subclass) constructor or however you start your RMI application.


Now all your communcation is compressed when sending and decompressed when receiving. It does have a performance hit in your application itself (both client and server need to (de)compress) but the network traffic itself will be compressed.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!