Reputation: 5792
I am having a problem passing JSON from PHP server and ASP.NET server. I am getting Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 48 bytes)
I am looking for a way to compress the JSON.
Thanks
Upvotes: 0
Views: 711
Reputation: 113242
Flush the output buffers regularly, so you don't need to have more than a few KB to produce your many MB stream.
Upvotes: 0
Reputation: 12850
Compressing the JSON will probably not change anything, since you'll need the uncompressed JSON before you can compress it (ie. you'll end up using even more memory then you are using currently).
Upvotes: 1
Reputation: 101
.NET has built in compression classes. Such as the DeflateStream or GzipStream classes located in the System.IO.Compression namespace. They should do the trick.
Upvotes: 0