browser leaks memory during automated webrtc testing
Reported by
dmcletc...@gmail.com,
Jun 24 2016
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 Example URL: n/a Steps to reproduce the problem: I'm not 100% sure that this is reproducible. We ran out of memory doing automated testing. 1. We made a few thousand webrtc calls. 2. memory use was high, and the javascript console had memory errors. 3. task manager showed high memory use. What is the expected behavior? memory use should not grow over time What went wrong? To tell the store more as I found it ... My javascript code was getting net::ERR_INSUFFICIENT_RESOURCES errors in the console. It was trying to allocate new objects. I did a profile heap snapshot in the dev tools, and my heap is 16 MB, so I don't think that it's the javascript using the resources. I suspect the browser. I checked the chrome task manager, and it's reporting that my tab is using 444 mb, the GPU is using 154 MB, and "Browser" is using 101 MB. The 444 number is a lot higher than I typically see. So I suspect that the leak is somewhere in webrtc. (The web page is using webrtc to place/receive calls over & over. Did this work before? N/A Is it a problem with Flash or HTML5? HTML5 Does this work in other browsers? N/A Chrome version: 50.0.2661.94 Channel: stable OS Version: Flash Version: I searched and found some stale bugs that seemed similar, but they were all related to leaving a call up for an extended period. Do you guys have any automated scripts for end-to-end testing? I can try to test this will apprtc to narrow down the problem if that will help. I think that the logs will be too big if I do a chrome log or a webrtc event log. and I don't know how helpful logs are for a memory leak.
,
Jul 11 2016
[triage]: Ok, we need some more information in that case. Maybe if you can use https://chromium.googlesource.com/chromium/src/+/master/components/tracing/docs/heap_profiler.md and get a memory dump when you believe WebRTC has leaked memory? Please do that and attach to this memory report.
,
Aug 11 2016
dmcletchie@ : Could you please update the thread according to the above comment # 2.
,
Aug 11 2016
Hi - Sorry, I have not had time to do that testing. I'll try to make time next week.
,
Aug 19 2016
Thank you for providing more feedback. Adding requester "phoglund@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Aug 23 2016
Correcting incorrect label change by sheriffbot in #5; it would still be useful to get additional data as mentioned in #2. hta: another WebRTC performance topic... Have your team done any measurements like this? Any other comments regarding the reported high memory usage? Does the numbers sound reasonable?
,
Aug 23 2016
Is the script available for inspection? A PeerConnection object has a fairly large memory footprint, and if the script hangs on to the PeerConnections, or adds some handler that might fire in the future and doesn't totally shut it down before releasing it, they might legitimately accumulate. We're pretty aggressive about not leaking memory, but if Javascript asks us to keep it all, something will eventually break. That said, there have been issues in the past, so I'm interested in seeing the script in question, if possible.
,
Sep 9 2016
[triage] dmcletchie@: Could you please respond to comment #7?
,
Sep 9 2016
I can't share the script - sorry. It's part of a big web app. But I totally see what you're saying, and I'm not 100% sure that it's not me. I checked my callbacks for things like onicecandidate, onaddstream, onremovestream, and I don't think that any of them can hang. for the most part, they either send things over a websocket or call back into the peerConnection. I think that i'm calling peerConnection.close(); and setting peerConnection = null; at the end of every call. I only have 1 peerConnection variable, so if I did neglect to call close, or something like that, will the javascript engine garbage collect & clean it up? could it leak c/c++ memory if it gets GC'd before I call close? I'm just trying to think of what I could be doing... I tried to set up a similar test with the apprtc project, but I could not get more than 2 or 3 calls in without some kind of problem with the room availability. (even manually, calling from one tab to another on my PC, i could not get more than 3 or 4 calls) It looks like that problem does not exist anymore, so i'll try to set up a test with apprtc some time soon. Sorry that I have not been more responsive
,
Sep 12 2016
[triage]: Ok, thanks for the update! I'll close the bug for now since it's not clear we have an issue; feel free to write here if you manage to repro with apprtc, and we'll re-open the bug. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by yini...@chromium.org
, Jun 29 2016