Is it possible to clear blob in chrome before using storage over restriction (500 MB)?

In the chrome extension, the program process will record β†’ stop β†’ load endlessly. The recorded files are saved as blob in Chrome after capturing the media stream, and then downloaded as a wav file on the local device. During the procedure, I also set revokeObjectURL() to free an existing url object. (ref: Javascript - File saved on disk stuck in Chrome's memory )

  var blob = mediaRecorder.blob; if (callback) { var url = URL.createObjectURL(blob); callback(url); URL.revokeObjectURL(url); } 

Before doing revokeObjectURL() , there were two kinds of data in chrome://blob-internals .

  • type 1:

     02e068bb-33a0-4759-a085-a4850cb9259a -Refcount: 1 -Content Type: audio/wav -Type: data -Length: 303,148 
  • type 2:

      blob:chrome-extension%3A//koexxkllffcmnhxlnhacmcnpjkcodngb//xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx - uuid: 02e068bb-33a0-4759-a085-a4850cb9259a 

After executing revokeObjectURL() type 2 is no longer displayed, but type 1 still exists. Is there any other method to clear type 1 data? I also saw garbage collection information ( https://developers.google.com/web/tools/chrome-devtools/profile/memory-problems/memory-diagnosis#determine-garbage-collection-frequency ), but I'm not sure Does the GC work before the 500 MB blob content is saved, which may cause the downloaded file to show "no file". At this point, memory usage increases slowly, but I'm worried that after a long test there may be a "low memory".

+5
source share

Source: https://habr.com/ru/post/1243633/


All Articles