[wp-trac] [WordPress Trac] #21098: Out of memory errors in XML-RPC

WordPress Trac wp-trac at lists.automattic.com
Thu Jun 28 21:47:23 UTC 2012


#21098: Out of memory errors in XML-RPC
---------------------------------+------------------------------
 Reporter:  koke                 |       Owner:
     Type:  defect (bug)         |      Status:  new
 Priority:  normal               |   Milestone:  Awaiting Review
Component:  XML-RPC              |     Version:  3.4
 Severity:  major                |  Resolution:
 Keywords:  mobile dev-feedback  |
---------------------------------+------------------------------

Comment (by maxcutler):

 I was unsuccessful in my first attempt to do some memory profiling on the
 XML-RPC code. Will try again in a week or two when I have more time.

 I'm hesitant to implement anything that artificially raises the memory
 limit. On shared hosting that may just cause more problems, and those are
 the environments that are likely seeing this problem currently anyways.

 If we want to return a better error, we'd have to use
 [http://www.php.net/manual/en/function.register-shutdown-function.php
 `register_shutdown_function`] with [http://us.php.net/error_get_last
 `error_get_last`] to catch the fatal exception and do something smarter.
 That seems like a major hack though.

 If we can find some memory usage optimizations, then great. But I think
 the real answer here is that this is the client's problem to deal with. If
 any XML-RPC methods do not support paging, then that's a feature we should
 add. Also maybe expose memory_limit in wp.getOptions to let client make a
 smart decision?

 And clients need to be smart about the quantity of data they request.
 While multicall might result in fewer HTTP requests on a mobile device,
 it's a big load on a server and it's going to require non-trivial memory
 on the client to buffer the response and do XML de-serialization. Use
 threading or other mobile OS provisions to have multiple XML-RPC requests
 in-flight simultaneously and let the network and OS optimize that.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21098#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list