Phase separation and critical size in molecular sorting