How to embed mjpg streams with tag without browser getting out of memory

The reason I’m using an <img> tag for the mjpg stream is that I’m able to size the image with css. However, after letting it run for a while, the browser crashes becuase it’s getting out of memory.

I’m currently using URL.revokeObjectURL(mjpgURLwithOutdatedRandomParam) and add a new random param to the URL every few seconds. But unfortunately, the browser still crashes with Out of Memory.

What simple/optimal solution is there?

PS: I don’t understand how a browser can support mjpg (within an <img> tag) but not be prepared to handle the memory…