Adding strdup for windows, adding memory limit code