calculate relative memory