Zaid-Ajaj / Fable.Remoting

Type-safe communication layer (RPC-style) for F# featuring Fable and .NET Apps
https://zaid-ajaj.github.io/Fable.Remoting/
MIT License
272 stars 55 forks source link

Remoting.Client: dispose of the CancellationTokenRegistration when done #357

Closed PierreYvesR closed 6 months ago

PierreYvesR commented 6 months ago

Otherwise the XMLHttpRequest is not being garbage-collected (observed in Firefox, Chrome, and Edge)

kerams commented 6 months ago

Interesting. So this causes a memory leak with every request in every application?

PierreYvesR commented 6 months ago

When using the Fable (javascript) client library, it seems so. I've used a freshly-created SAFE-stack template for testing (as per https://safe-stack.github.io/docs/quickstart/): the number of XMLHttpRequest never goes down in the memory profiler. On one of our apps doing a few 1MB requests per minute, memory would run out after a few hours at around a few GB.

Zaid-Ajaj commented 6 months ago

Thanks @PierreYvesR I've merged and published this as of Fable.Remoting.Client v7.30 please take it for a spin and let us know if everything is alright