Additional SQL Server features and topics not covered by specific categories
You will need to do this manually, as the two instances are not aware of each other. With 38GB available, you are looking at about 30GB available to split between the two. The easy thing is to assign a max memory of 15GB to each, but chances are they don't have equal workloads, so you will want to adjust accordingly. HTH