script size check (fitting shmem size boundaries)