Rud*_*udy 5 javascript google-chrome blob google-chrome-extension
在chrome扩展中,程序的进程将无限制地进行记录 - >停止 - >下载.录制的文件在捕获媒体流后在Chrome中保存为blob,然后在本地设备中下载为wav文件.在此过程中,我还设置revokeObjectURL()释放现有的objectURL.(参考:Javascript  - 保存到磁盘的文件卡在Chrome的内存中)
        var blob = mediaRecorder.blob;
        if (callback) {
            var url = URL.createObjectURL(blob);
            callback(url);
            URL.revokeObjectURL(url);
        }
在做之前revokeObjectURL(),有两种数据chrome://blob-internals.
类型1:
02e068bb-33a0-4759-a085-a4850cb9259a
  -Refcount: 1
  -Content Type: audio/wav
  -Type: data
  -Length: 303,148
类型2:
  blob:chrome-extension%3A//koexxkllffcmnhxlnhacmcnpjkcodngb//xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
  - uuid: 02e068bb-33a0-4759-a085-a4850cb9259a
之后revokeObjectURL(),类型2不再显示,但类型1仍然存在.有没有其他方法可以正确清理类型1数据?我还看到了有关垃圾收集的信息(https://developers.google.com/web/tools/chrome-devtools/profile/memory-problems/memory-diagnosis#determine-garbage-collection-frequency),但我是不知道GC是否在blob存储超过500MB之前运行,这可能导致下载的文件显示"无文件".在这个阶段,内存的使用缓慢增加,但我担心在长期测试后可能会导致"内存不足".
| 归档时间: | 
 | 
| 查看次数: | 1047 次 | 
| 最近记录: |