Why does it need so much RAM? It should only need to store the block hashes which should not need anywhere near that much RAM. Inline dedupe is pretty much standard on high-end storage arrays nowadays.
(5GiB / 1TiB) * 4KiB to bits
((5 gibibytes) / (1 tebibyte)) × (4 kibibytes) = 160 bits