More accurate memory estimation. Added paths option