build: apply_profile: some tweaks for lowmem