For the same 4K H.265/MKV file of 4 GB, on a Smart TV with 3 GB of RAM, the following is typical if playback runs smoothly:
With hardware:
ExoPlayer: approx. 250 to 600 MB
Kodi: approx. 350 to 700 MB
VLC: approx. 500 to 1,200 MB
With software:
ExoPlayer: approx. 600 MB to 1.5 GB
Kodi: approx. 700 MB to 1.6 GB
VLC: approx. 900 MB to 2 GB or more
Realistic order:
Lightest:
ExoPlayer with hardware
Intermediate:
Kodi with hardware
Heaviest:
VLC with hardware Even heavier
Any of the three software-based options, especially VLC.
Most importantly
The 4GB file isn't loaded entirely into RAM.
The RAM is consumed by the buffer, the player, and the decoding.
On your 3GB TV, hardware decoding is the best option.
Direct answer
For that specific case, I would estimate the following:
ExoPlayer + hardware: ~400MB
Kodi + hardware: ~500MB
VLC + hardware: ~800MB
ExoPlayer + software: ~1GB
Kodi + software: ~1.1GB
VLC + software: ~1.5GB