# Why does my script freeze and timeout when accessing a Singularity container?

**URL:** <https://ask.cyberinfrastructure.org/t/why-does-my-script-freeze-and-timeout-when-accessing-a-singularity-container/2528>\
**Category:** University of Alabama at Birmingham\
**Tags:** slurm, memory, singularity, scripting, bash\
**Created:** [September 22, 2022, 4:35pm UTC](https://ask.cyberinfrastructure.org/t/why-does-my-script-freeze-and-timeout-when-accessing-a-singularity-container/2528 "2022-09-22T16:35:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwarr](https://ask.cyberinfrastructure.org/letter_avatar_proxy/v4/letter/w/3be4f8/32.png) [@wwarr](https://ask.cyberinfrastructure.org/u/wwarr)\
**Post date:** [September 22, 2022, 4:35pm UTC](https://ask.cyberinfrastructure.org/t/why-does-my-script-freeze-and-timeout-when-accessing-a-singularity-container/2528/1 "2022-09-22T16:35:45Z")

</div>

I am using a script that calls a Singularity container. When it does, the script appears to freeze and eventually times out. Why is this happening and what can be done about it?

---

<div class="post-metadata">

**Author:** ![wwarr](https://ask.cyberinfrastructure.org/letter_avatar_proxy/v4/letter/w/3be4f8/32.png) [@wwarr](https://ask.cyberinfrastructure.org/u/wwarr)\
**Post date:** [September 22, 2022, 4:40pm UTC](https://ask.cyberinfrastructure.org/t/why-does-my-script-freeze-and-timeout-when-accessing-a-singularity-container/2528/2 "2022-09-22T16:40:52Z")

</div>

If the amount of memory used by the Singularity container exceeds the memory available for the job, the script will hang. Expected SLURM behavior is to terminate the job when its memory is exceeded, however the use of a Singularity container defies this expectation.

To more definitively diagnose the issue, try using the `seff` command after the script has timed out or otherwise ended. The `seff` command will display memory usage of the job. If the job had 100% usage, or very nearly 100% usage, it is likely the container is using too much memory.

To resolve the issue, please find ways to reduce memory usage or increase memory allocated to the job.
