comparison memory management