You can actually set heap to 31GB. The primary benefit of providing the OS with more RAM is having a larger page cache. This can reduce the number of disk reads necessary for completing queries, and thus improve performance. That said, there will be diminishing returns beyond 128GB total RAM.
If you have very large servers, e.g. 64 cores/128 theads and 256GB or more RAM, you will usually get better results running multiple ES nodes on the server. It is however important that each server has its own dedicated storage. If you run multiple nodes and really want to maximize performance, you can bind each node to specific cores, respecting socket and chiplet (on EPYC) boundaries.