Is there any way to force the Javascript Garbage Collector in webkit based browsers?
firefox, garbage-collection, javascript, memory-leaks, webkit
Solution
(Not just limiting this answer to WebKit-based browsers...)
- Chrome: if you launch it from a command line/terminal with `--js-flags="--expose-gc"`, then it provides `window.gc()`.
- Firefox I think requires clicking the "Free memory" buttons in `about:memory`.
- Opera has `window.opera.collect()`.
- Edge has `window.CollectGarbage()`.
- Safari, unknown.
Note that you shouldn't be manually running the GC. I've only posted this because it's useful for development testing.
Problem
In internet explorer we can force the Javascript garbage collection to execute with this method: CollectGarbage(); That method is undefined on Firefox. Do you know if there is some kind of equivalent? Thanks.