System seems to freeze when browsing Firefox randomly

Hello, I’m kind of new to Linux and EndeavourOS, I have played in the past with Ubuntu a couple of times and now plan to make this move to EndeavourOS so I can leave Windows behind for good; so sorry in advance if it seems I describe my issue vaguely.

It seems that just having Firefox watching Apple TV make the system completely freeze for randoms amount of time (30-40 seconds); I can’t move the mouse nor use the keyboard, the screen freezes but the audio seems to keep playing, when the freeze passes over the mouse and keyboard catch up with anything I’ve done to them. It doesn’t happens when whatching AppleTV alone nor doing anything special with Firefox. I am not even sure if the problem comes from Firefox to be honest.

I’m using the following setup:

Operating System: EndeavourOS 
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 20 × 12th Gen Intel® Core™ i7-12700K
Memory: 31.1 GiB of RAM
Graphics Processor: NV174
Manufacturer: ASUS

Now that I watch the system monitor I see Firefox served with 1’5Gb of RAM on idle.
Going into about:support:window protocol I see I have wayland

Does anybody have any clue about what tests can I run o what can I do in order to troubleshoot and fix my issue?

Are you using proprietary nvidia drivers or nouveau, I also had a simillar issue on an older gpu (390 driver so very old). On the proprietary drivers I had the same freezes you were describing with the audio loop and everything. Nouveau drivers “fixed” it. Try using it with nouveau, if it doesn’t freeze, the drivers are the problem. I don’t remember what I did with proprietary drivers several years ago, and I don’t even use an Nvidia gpu now. I hope someone else could help you in case the drivers are the problem. Also this is a common issue, many people had (or still have) with Nvidia drivers. It could also be a high ram usage but it’s not the case as you have lots of ram and you were just using firefox as you say.

Try disabling hardware acceleration in Firefox: Settings → General → Performance, then uncheck “Use recommended performance settings”. Restart your browser and see if there is an improvement?

I think I’m already using nouveau:

~ inxi -G
  Device-1: NVIDIA GA104 [GeForce RTX 3070 Ti] driver: nouveau v: kernel
  Device-2: Logitech HD Pro Webcam C920 driver: snd-usb-audio,uvcvideo
    type: USB
  Display: wayland server: v: with: Xwayland v: 24.1.0
    compositor: kwin_wayland driver: X: loaded: modesetting dri: nouveau
    gpu: nouveau resolution: 1: 1920x1080 2: 2752x1152
  API: EGL v: 1.5 drivers: nouveau,swrast
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.5 compat-v: 4.3 vendor: mesa v: 24.1.1-arch1.1
    renderer: NV174
  API: Vulkan Message: No Vulkan data available.

I also have been monitoring Firefox while watching a show and the RAM goes to 2Gb like everything is normal. No hiccups this time.