Kenny Leung (inside) <[EMAIL PROTECTED]> writes:

> Hi All.
>
> My virgin posting to the list.
>
> I have an xmlrpc server set up, and it receives big chunks of data
> via remote calls. Because the call handling is multithreaded, I can
> receive more calls than I can really handle. The memory usage goes
> up until I eventually run out of memory. How can I guard against
> this? Is there a way to get the server to serialize its requests
> instead of running them in parallel?

Due to spec restrictions, the current XML-RPC implementation is not
optimized with regard to memory usage.  I don't know of a way to
serialize the requests off hand, and wouldn't suggest doing so any
how.  What you really want to do is introduce a throttling mechansim
which kicks in when you get close to maxing out your memory.  One way
of doing this would be to allocate a block of memory when the server
starts up, and when an OutOfMemoryError is thrown, release that
pre-alloc'd block and start throttling.

Some code which does configurable throttling would be a nice
addition.  The development list is the place to discussion such
changes.

- Dan

Reply via email to