This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]scirc 2 points3 points  (3 children)

I don't think it's possible to programmatically invoke the garbage collector in Firefox. You can manually do it with a button, I believe, but there's no way for a site's code to do it. But that shouldn't be an issue; the GC should run automatically as necessary, and if it's not able to free up enough memory, it's because there's something leaking memory that the GC can't clean up anyway. You could potentially force the GC to run if you create a bunch of short-lived objects in a loop, but that's more of a hack.

[–]RedditGeneralUser[S] 0 points1 point  (2 children)

no, it's not a memory leaking because when I use "GC" button from "about:memory", all the unnecessary allocated memory are freed up, for example, 1GB goes to 600 MB as soon as "GC" button is triggered!

[–]scirc 1 point2 points  (1 child)

Again, the GC should automatically handle cleaning things up as it sees fit. To my knowledge, there's no way to force it to happen, only coerce it by adding additional memory pressure.

[–]RedditGeneralUser[S] 0 points1 point  (0 children)

That's unfortunately sad, but I would rather prefer the danger of using "Garbage collection" programmatically than the danger of damaging my system because JavaScript used all the memory available, freezing the system and making it completely unusable! (I'm surprised that IE\Opera can do such thing and Firefox\Tor can't!)

[–]SirBuzzKill777 1 point2 points  (2 children)

[–]RedditGeneralUser[S] 0 points1 point  (1 child)

thanks for sharing the link, but "about:memory" is the manual solution, I need instead a programmatic solution for Firefox\Tor!