Canonical used to recommend Raspberry Pi 4 with at least 4GB RAM to run Ubuntu Desktop, but Ubuntu 22.04 LTS should run more smoothly on the Raspberry Pi 4 2GB as the company has enabled zswap by default to allow the Linux operating system to run better on systems with less memory.
Source: LXer – Ubuntu 22.04 LTS to leverage zswap to run on Raspberry Pi 4 with 2GB RAM