How `maxHeapMemory` is calculated

TypeScript SDK has this maxCachedWorkflows config that mentions a formula based on max. heap memory.

We want to use a different config, as we suspect 600WF per GB might be too much in our case.

How’s this max. heap memory calculated? Just so we can use the same formula, but with a different value.