我正在开发一个实时媒体浏览/播放应用程序,在浏览器中使用<video>
个对象进行播放(如果可用).
我混合使用了纯javascript和jQuery,
My concern is specifically with memory. The application never reloads in the window, and the user can watch many videos, so memory management becomes a large concern over time. In testing today, I see the memory profile jumping by the size of the video to be streamed with each subsequent load, and never dropping back down to the baseline.
I've tried the following things with the same result:
1-清空包含创建的元素的父容器,例如:
$(container_selector).empty();
2-暂停并删除与"视频"匹配的子项,然后清空父容器:
$(container_selector).children().filter("video").each(function(){
this.pause();
$(this).remove();
});
$(container_selector).empty();
Has anyone else run into this issue, and is there a better way to do this?