binji / binjgb

Gameboy emulator implemented in C, that also runs in the browser
https://binji.github.io/binjgb/
MIT License
534 stars 61 forks source link

Huge RAM usage. #46

Open welovfree opened 2 years ago

welovfree commented 2 years ago

I was playing "Super Mario Bros. Deluxe (USA, Europe)" using the emulator in the website and noticed that it's using lots of RAM

binji commented 2 years ago

What browser were you using? How did you measure RAM usage?

welovfree commented 2 years ago

What browser were you using?

I am using Chrome Version 101.0.4951.41 (Official Build) (64-bit)

How did you measure RAM usage?

I used both Windows task manager and Chrome task manager

1Rf9LGQiBn_04-05-22 ONcfoHu5mf_04-05-22

And this is how the game's screen looks like when I terminate the process in Windows task manager, and that's how I confirmed it's the process that corresponds to the emulator.

T2kvWGUifz_04-05-22

binji commented 2 years ago

That's the GPU process, which handles all the graphics for Chrome. binjgb uses the GPU to render, so it will stop working if you kill that process.

binji commented 2 years ago

If you want to measure how much ram the page is using, the best way is to load devtools on the page, then go to memory and take a heap snapshot.

welovfree commented 2 years ago

Isn't that too much for a GPU process to take that amount of memory? As shown in the Chrome task manager I think the page doesn't take too much of memory, the "Huge RAM usage" I was referring to is the one taken by that GPU process, or maybe I'm missing out on something.

The heap snapshot

YnlnOxtR5r_07-05-22