hdrs icon indicating copy to clipboard operation
hdrs copied to clipboard

hdrs async open can cause memory leak

Open fMeow opened this issue 11 months ago • 2 comments

Change async_open back to open massively reduce memory usage. Invesigating.

  • updated (2024.03.23) Setting log level to TRACE, I foundhdrs::File instances correctly dropped. And I tried offload hdrs file reading operation to avoid blocking on async runtime via tokio::task::spawn_blocking and it works like a charm. So it is highly possible that the underlying blocking mechanism currently at use is at fault.

fMeow avatar Mar 19 '24 07:03 fMeow

Maybe related to blocking::Unblock?

Xuanwo avatar Mar 21 '24 06:03 Xuanwo

Agree, though I don't have evidence. Maybe Unblock does not correctly free memories of data that passed back to original async runtime?

fMeow avatar Mar 23 '24 01:03 fMeow