Util.pm: change window memory calculation