Memory consumption of overwolf.io.listenOnFile

Hello,

I’m noticing a huge memory consumption of the overwolf.io.listenOnFile API when used on big files, even when a void handler is passed to the API.

To reproduce the issue:

  • Download the debug apk from there
  • Launch Hearthstone
  • Download the log file from there
  • Copy it to the Hearthstone/Logs folder
  • Open the devtools for the “Firestone - Background” window, and run debugListenForLogs(). This will call the overwolf.io.listenOnFile API on the new Power2.log file that you just copied, with an empty handler (meaning the results of the file being read in the callback will simply be ignored)
  • If you look in the Task Manager, you see the memory used by the Firestone process climb quite high, and not go down even after forcing a garbage collection from the dev tools. For me, it goes from 300 MB before reading the log file to 600 MB after reading it. Also please note that the memory doesn’t go down even after waiting for a while.

It’s possible that it’s simply some memory waiting to be GCed, but I don’t know how to force the garbage collection on the API side :slight_smile:

Just a few clarifications:

You mentioned the empty handler - you mean the last param? The callback? which param? have you tried not to send an empty handler? Is it a new API that you are using, or you used it before? What was changed?

Thanks.

Yeah sorry, I meant that the callback parameter in listenOnFile(id, path, option, callback) is simply () => {}.

And of course, using a “real” handler had the same effect, I just wanted to use the empty handler/callback to try and narrow down where the memory was coming from.

And I’ve been using it for a while, but just recently starting to look into the memory consumption of the app that was getting out of hand.

OK I will investigate it and let you know.

Thanks

An update: the ticket has been forwarded to the R&D. I will update you here. Thanks

i test the attached power.logs file on my sample, and the memory looks ok… (around 130 MB… and stable)

@sebastientromp currently from our test, we couldn’t find any issues with the overwolf.io.listenOnFile API. However, we recommend keeping an eye on it. If you find any problems, please update the exact steps to reproduce and more vital info as memory consumption.

If necessary, we can offer some external plugins to read big files in chunks, but I wouldn’t go on this path if there are no issues or degraded performance.

Thanks.

1 Like

Thanks for the investigation! I will keep an eye open for this then, and update here if I observe issues.

1 Like

I’m closing the ticket. But feel free to mention me to reopen it as necessary.

Thanks

1 Like