With the caution that I’m not a super user, IMO I’d say, stay the course.
I have a OH5 test system on a rpi4-2G with Zwave2Mqtt (ZUI) that uses 0.75 GB of RAM. The first startup of the upgrade (M1) (from 4.3.3 - just changed the image in docker compose), was messy, but a restart of the container cleared everything up. Just using the java 21 in the package. 8GB is going to be plenty
FWIW- Similar experience with Rpi5-4G (production OH5, another ZUI install, MQTT, MariaDB containers) totaling 1.75 GB RAM. Again, the transition to OH5M1 required a restart
EDIT: Debian 12 (bookworm?) 64-bit OS