Problem is memory allocation due to a SQL issue. How many rows would you expect this query to return: SELECT COUNT(*) FROM a_table LIMIT 10 I was expecting this to return 10. Stupid really, it returns 1 row! Which contains the total number of rows in the table. You can guess the rest... Allocating too little memory etc... This was the problem with another non-SDI webservice I am working on. It may be your problem. But it's a bugger to find, so if you can let me know if you still have this problem (with suggested re-coding) it would help me.