Open Bug 1505509 Opened 6 years ago Updated 2 years ago

Build up of webrtc.org platform threads while running web-platform tests

Categories

(Core :: WebRTC: Audio/Video, enhancement, P2)

65 Branch
enhancement

Tracking

()

Tracking Status
firefox65 --- affected

People

(Reporter: dminor, Unassigned)

References

Details

While running the webrtc web-platform tests we see a build up of webrtc.org platform threads. On win32, we're very close to OOM. The branch update in Bug 1376873 was backed out due to intermittent OOMs while running these tests, but even without the branch update, OOM can occur if we double the stack size allocated in platform_thread.cc [1]. In one of those crashes, we see roughly ~1200 calls to the constructor and only ~800 calls to the destructor prior to the crash.

With the branch update applied, we end up creating more platform threads while the test runs, moving from ~1800 to ~2250 on my Linux system. Reducing the stack size for the platform threads makes it so the tests will pass on win32. See also [2].

We should see why we're accumulating web platform threads. If the tests run to completion almost all are eventually destroyed by the end of the run. On my Linux system, I end up with 1820 calls to the constructor and 1781 calls to the destructor. We should investigate why we're not seeing an equal number of calls to the destructor, but the more important problem is why those threads are persisting so long prior to destruction.

[1] https://treeherder.mozilla.org/#/jobs?repo=try&revision=da8b17102e99bb8b52148f62f88ee6d95d32ccf1
[2] https://phabricator.services.mozilla.com/D11090
Just adding a note here that last Friday in https://mozilla.logbot.info/media/20181102#c15561193 we observed "out of memory" sometimes manifesting instead as 

  # Fatal error in z:/build/build/src/media/webrtc/trunk/webrtc/base/platform_thread.cc, line 227
See Also: → 1580301
Depends on: 1568296
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.