When does it make sense to use hugepages in Postgresql?
Usually when your shared memory footprint is very large, i.e. primarily very large shared_buffers. In practice, huge pages tend to pay off on dedicated, high-throughput systems where shared_buffers is really big (often tens of GB, and very commonly you start caring around ~100GB+) and you have high concurrency / tight latency goals.
Is usage of hugepages only available in release 18?
No, huge pages support has been around since PostgreSQL 9.4. But starting with PostgreSQL 15, it’s much easier to size/configure because PostgreSQL can tell you the required count via the runtime-computed setting shared_memory_size_in_huge_pages, before that you needed to calculate it on your own.