I am tuning my linux machine running Elasticsearch. It says that I should give at least half the memory of the machine running elasticsearch to the filesystem cache. But I don't know how much of it is given currently to filesystem cache. How to find it? And how to change it to half of the RAM?
You won't give memory to the file system cache, because it is part of the page cache.
You may need to have enough physical RAM to make that possible (so you might need to buy more RAM).
Of course, if you have big processes running (outside of Elasticsearch) you might terminate or stop them.
See also setrlimit(2).