I’m not sure why that’s a surprise, if you’re spawning 1000s of closures in any systems you’ll accumulate memory usage. Once the tasks all resolve and you’ve stopped creating new ones, does the memory settle again as the GC cleans up?
Well the GC will try to wait until it really has to do work as it blocks the whole thread while it does. So if there’s memory available and you’re still asking for more tasks it will probably just wait
I’m not saying there’s no chance of a memory leak, but the description you’ve given sounds like a great way to make any API appear to be leaking memory
Like I said before, based on your description you are creating 100s of requests every second, and you resolve them after some number of seconds. Increasing memory usage shouldn't be a surprise here