Switching to query posts solves memory errors.