users@glassfish.java.net

Why are Remote method calls so expensive?

From: <glassfish_at_javadesktop.org>
Date: Wed, 23 Jan 2008 22:46:45 PST

I have a Remote EJB, and a WAR callig it. The WAR and EJB are in the same container, but the WAR is not in the EJBs EAR, so it needs to be a remote call.

The result of the call is large -- a List of 2000+ items. Thankfully, this is cached in the client WAR, but we need to do this one time load.

But when the method returns the resulting list, my heap SURGES over 200M for this single call.

I added a little blurb of code that simply writes the List out to a file via an ObjectOutputStream, and the final file is ~1.6M in size.

Now, all of that 200M in the surge is garbage, but it's some big garbage. If I reduce my heap size, this call will give me an Out of Memory exception, so whatever it is doing with that memory, it's doing it all at once.

Why are these remote methods so expensive?
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=255527