Repository: yt-dlp
Issue: Memory usage is very large for some videos
Labels: bug,help-wanted

### Checklist

- [X] I'm reporting a bug unrelated to a specific site
- [X] I've verified that I'm running yt-dlp version **2022.04.08** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/ytdl-org/youtube-dl#video-url-contains-an-ampersand-and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues including closed ones. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Description

Memory usage spikes when downloading certain videos. For example:
```
yt-dlp 'https://www.youtube.com/watch?v=mivcDoTjpQE' --output -  >/dev/null
```
See the video here: https://www.youtube.com/watch?v=mivcDoTjpQE

Memory usage spikes up to 570MB. This can cause out of memory errors on embedded computers like raspberry pi.
```
% grep ^VmPeak /proc/1945/status
VmPeak:	  584292 kB
```
 Possible related to https://github.com/yt-dlp/yt-dlp/issues/2512

### Verbose log

```shell
% yt-dlp 'https://www.youtube.com/watch?v=mivcDoTjpQE' --output -  -vU >/dev/null
[debug] Command-line config: ['https://www.youtube.com/watch?v=mivcDoTjpQE', '--output', '-', '-vU']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8
[debug] yt-dlp version 2022.04.08 [7884ade65]
[debug] Python version 3.9.2 (CPython 32bit) - Linux-5.15.32-v7+-armv7l-with-glibc2.31
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 4.3.3-0, ffprobe 4.3.3-0
[debug] Optional libraries: brotli, certifi, Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
Latest version: 2022.04.08, Current version: 2022.04.08
yt-dlp is up to date (2022.04.08)
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=mivcDoTjpQE
[youtube] mivcDoTjpQE: Downloading webpage
[youtube] mivcDoTjpQE: Downloading android player API JSON
[youtube] mivcDoTjpQE: Downloading MPD manifest
[youtube] mivcDoTjpQE: Downloading MPD manifest
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Default format spec: best/bestvideo+bestaudio
[info] mivcDoTjpQE: Downloading 1 format(s): 18
[debug] Invoking downloader on "https://rr4---sn-j5caxoxu-pn2d.googlevideo.com/videoplayback?expire=1649675156&ei=NLdTYq3ELoKFgwO7wayYAw&ip=69.112.107.63&id=o-AHc1dUd-gwVFXzXkEJuUTSlHD0wAIHJlVifZcBWrSaNs&itag=18&source=youtube&requiressl=yes&mh=QP&mm=31%2C26&mn=sn-j5caxoxu-pn2d%2Csn-p5qddn7d&ms=au%2Conr&mv=m&mvi=4&pl=21&initcwndbps=1657500&vprv=1&mime=video%2Fmp4&gir=yes&clen=10130610015&ratebypass=yes&dur=720000.383&lmt=1596607579855703&mt=1649653251&fvip=5&fexp=24001373%2C24007246&c=ANDROID&txp=6216222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAJbYUNcDmLFvkl_PCci-A_Z53F9100gJ3RVtfmm2u5taAiB1IYet8SM9FXiMRSMrEYEYdyvaIxEwoUOsbxklRpUYMQ%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgTOoOzUVl1xiRl0i2I-Je5t0rm7rz1hMlKRKLeeKGadoCIQDpdoqdzXVUWT2IIgmg1EQhzpW78pb5QirOb8KXlxUw0g%3D%3D"
[debug] File locking is not supported on this platform. Proceeding without locking
[download] Destination: -
[download]   3.4% of 9.43GiB at 12.32MiB/s ETA 12:37
```