jquery.terminal: Increase Consumption of Memory Using Too Many Echo()

I have question related to jQuery Terminal

I made an application that will has like 8 terminal instances open at the same time. While using the for loop to call .echo() on each terminal, the memory just keep building up (According to the Windows Task Manager) the msedgewebview2.exe is going from 90MB to 120MB and more and more… Is there a way that I can fix this issue? I don’t think JQ Terminal instance will save all of my echo output right?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 32 (32 by maintainers)

Commits related to this issue

Most upvoted comments

Just realized that I should probably add a timer to cached values. So they are removed from cache and probably timeout option.

I was testing again and got errors from the library. It turns out that you can’t use strings as keys in WeakMap. I’m not sure how it was working when testing your app.

I would need to delete the API clear_cache since it will not be needed anymore.

I think that it fixed the issue, I started with ~700MB of memory for your application then it grow to about 900MB but after some amount of time, it decreased to ~700MB again so it probably garbage collected everything including DOM nodes.

Sure, I will check with the profiler maybe I will find something.

I’ve added milestone 2.33.0, I don’t use them much, but this will make me prioritize the issue. Since I think it’s critical. Memory leaks are bad.

There is clear_cache method, I think that It’s not documented.

there is one thing that may cause memory growth, which is cache. To speed up rendering there is a cache that saves all output in Map I can maybe create some invalidation of that cache (after some amount of time) or use WeakMap for this.

It seems there is also an option useCache you can try to disable the cache.