Re: Help: UnmarshalException running Jini

Gregg Wonderly <[email protected]> Mon, 21 Apr 2008 09:34:31 -0500
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
SamsonLim wrote:
> It seems like I was able to resolve the errors by batching the tasks such
> that the number of entries in the space at any one period doesn't blow out
> of proportion, which it did in my case since hundreds of thousands of task
> entries were created at a much faster rate than the workers executing the
> tasks. 

In distributed applications, you have to create some kind of throttling 
mechanism to control the use and consumption of resources, or you will get 
overruns like this on incoming requests.

 > I guess there's nothing wrong with the code, just flaws in the design
> of the problem. Despite the very good discussion on 
> http://osdir.com/ml/java.sun.javaspaces/2004-01/msg00056.html
> http://osdir.com/ml/java.sun.javaspaces/2004-01/msg00056.html , do we now
> have a way to know for sure this memory/entries limit on a space?

The JVM doesn't provide any memory allocation throttling controls unfortunately. 
  One way to do this is to have a throttle built into your consumming space 
client which writes an idle entry into the space to indicate the availability of 
resources in the space.  Your writing space clients, would then perform a take 
on such an entry before they could write.  You could include a "size" or "count" 
in that throttle control which grants a the taking client that many writes (to 
play fairly).  Then, you could remotely bump up that throttle count to "tune" 
the system for maximum through put.  The consumers would read the "size" from 
someplace, such as a space entry that could be overwritten for tunning, and then 
create "available" Entry objects using that value.

Just some thoughts...

Gregg Wonderly

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]