Cannot write into Aerospike (Cannot allocate as_string)



We are getting error message “Cannot allocate as_string” when we are trying to write into Aerospike using PHP client library. The strange thing is that this is happening only in few cases (problematic objects have around 60kB). Most of the writes are successfully finished. We are using igbinary serialization but even if we change it to default PHP serialization we are still experiencing the same problem.

We found that that the error could originate from this: (line 293-299). But the constant AS_MAX_STORE_SIZE is set to 1024 so I don’t see how it correlates with size of our object.

Thanks Martin


Hey, please open this as an issue on the GitHub repo aerospike/aerospike-client-php. If you have sample data that can trigger the bug, that would be great.


@pdixons I also have the same problem which I already created a Github issue


@pdixons if you’re seeing the same thing as Kien’s Issue 43 please add whatever information you have. We’ll tackle it soon.


We have found the cause of our problem. The situation will occur when the array contains more than 1024 objects. In that case the serialization callback runs for each object separately and obviously there is 1024 limit. So we have implemented workaround when we are serializing the whole array ahead of internal serialization. As the constant AS_MAX_STORE_SIZE is set to 1024 it seems to me that this is a feature not a bug.


:rocket: :construction: