I think the answer will depend on many factors, many of which are difficult to predict.
IMO, the most practical way to determine the size of a safe heap is through trial and error. I would start with a maximum heap of about 15 GB in size, look at the system memory / paging statistics and adjust up or down.
source
share