Ubuntu – Ubuntu freezes while FF or Chromium are running


Following a regular software update my Ubuntu installation became unstable. The problem first manifested on 16.04. Each time I opened Firefox 53.0, the whole system froze within a minute of browsing. Traditional keyboard shortcuts were unable to unfreeze it. Reinstalling FF didn't help. Switching to Chromium didn't help – the problem persisted in exactly the same form, only in Chromium. Upgrading to 16.10 didn't help. Upgrading to 17.04 changed the nature of the problem slightly – now, FF freezes and unfreezes very frequently, every couple of minutes. I do not experience problems running applications other than FF and Chromium. Do you have any suggestions what further steps I might take to fix this?