presto-resource-group-managers/src/main/java/io/prestosql/plugin/resourcegroups/AbstractResourceConfigurationManager.java/AbstractResourceConfigurationManager/AbstractResourceConfigurationManager
class AbstractResourceConfigurationManager:    protected AbstractResourceConfigurationManager(ClusterMemoryPoolManager memoryPoolManager)
    {
        memoryPoolManager.addChangeListener(new MemoryPoolId("general"), poolInfo -> {
            Map<ResourceGroup, DataSize> memoryLimits = new HashMap<>();
            synchronized (generalPoolMemoryFraction) {
                for (Map.Entry<ResourceGroup, Double> entry : generalPoolMemoryFraction.entrySet()) {
                    double bytes = poolInfo.getMaxBytes() * entry.getValue();
                    // setSoftMemoryLimit() acquires a lock on the root group of its tree, which could cause a deadlock if done while holding the "generalPoolMemoryFraction" lock
                    memoryLimits.put(entry.getKey(), new DataSize(bytes, BYTE));
                }
                generalPoolBytes = poolInfo.getMaxBytes();
            }
            memoryLimits.forEach((group, limit) ->
                    group.setSoftMemoryLimitBytes(limit.toBytes()));
        });
    }