Open Bug 1274100 Opened 8 years ago Updated 2 years ago

Provide a mechanism to trigger CC/GC in Worker JS for writing tests

Categories

(Core :: DOM: Workers, defect, P5)

48 Branch
defect

Tracking

()

People

(Reporter: bkelly, Unassigned)

References

Details

(Whiteboard: btpp-backlog)

In bug 1273920 I find I need to trigger a CC/GC in a worker JS runtime in order to demonstrate a bug.  I can't find any way to do this in my test.  So for the moment I'm using a lame setTimeout().  It would be nice if we could expose some kind of worker forceCC().
Do we expose any testing APIs in workers?

Perhaps the global scope in workers could have a getter for some Gecko internal testing API, which is enabled only while running mochitests and such (so, if some pref is enabled).
That API could have ways to trigger GC, CC, and GC+CC, and also random other stuff.

I guess we could expose similar getter/API in Window context too.
Component: DOM → DOM: Workers
Note that in bug 1273920 comment 25 Andrew figured out a way to do this with our current support.  You basically have to child-cc-request observer topic and then ping/pong a postMessage() through the worker to know that it completed.
And child-gc-request.  Basically these are the tools about:memory use to trigger GC/CC in workers.
Whiteboard: btpp-backlog
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.