Closed mostend closed 2 years ago
What makes you think this is a problem and not just normal Go memory management? Did you look for where the problem is?
yes, I've tried many times, and when you keep calling events, memory keeps going up and doesn't go down. Although I changed timer to time.Second.
It even ended up with memory go to 1G and higher. This problem is not a memory rise quickly problem, it's very much like a memory leak problem.
Many thanks.
Yeah right. I'll have a look. Thanks for investigating 👍
Looks like it might be a ticker issue? https://developpaper.com/question/golang-time-newticker-memory-leak/
I suspect it might really be a memory leak in the native code. Shouldn't we release the NSString of the script, after it has been executed on the main thread?
Nice catch. It should be getting released by the ExecJS
method on the main thread.
@waini1110 - Please test the PR. Thanks 👍
this is simple clock program
Env :
html:
<p id="info"></p>
js:
go:
At this time, memory will rise very quickly, and continues to increase. from 24MB to 39MB and higher It's a lot like a memory leak issue.