Description
Hi! I'm Pacu! maintainer of Zcash iOS SDK. We've been using and
enjoying the library from quite some time now.
Describe the bug
Lately we changed the way we used GRPC calls from a long running stream (that could be hours downloading) to
sequential smaller calls, so we can download data and process it in parallel.
The problem with this is that we are now dealing with a huge chunk of small data structs being captured by GRPC inner workings and memory consumption spikes up heavily and quickly. I'm talking about obnoxious hundreds of MB in matter of seconds.
We are having problems figuring out whether this is a developer mistake from our side (us basically doing something wrong), "documentation bug" (API docs allow an undesired but yet permitted usage that causes the issue), or a grpc-swift (or any of its dependencies) bug.
grpc-swift versions: 1.15 and 1.16.0
What have we have tried so far
- We've reviewed that memory cycles are not being introduced on our side.
- We've reviewed all the documentation to make sure we are not messing up with unsupported calls
- We've updated to the latest version of the library.
To reproduce (sorry I don't have a sandboxed project to reproduce)
Steps to reproduce the bug you've found:
- clone main of Zcash iOS SDK
- run ZcashLightClientKitSample app on Xcode
- run mainnet variant (for quicker results)
- tap sync blocks
- look at the debug pane of Xcode how memory spikes


Something does not seem to be relinquishing memory
This is a stack trace of the allocs
Expected behaviour
I'd expect memory is released.
Additional information
This didn't happen when using a long running stream that told the server to stream a huge range of data. Only when we started to do subsequent smaller requests to the same streamer API