Start your terminal to use beginner mode.
Scenario
A container named mem_test running from image myapp:mem contains a memory stress script at /app/stress_memory.sh. Currently, the container runs with unbounded memory and can consume as much RAM as available on the host, preventing the OOM (Out of Memory) killer from terminating it even when it allocates excessive memory.
Task
Apply 100MB memory limits to the container so that running the provided stress script causes the container to be OOM-killed. Stop the container, restart it with memory limits applied using the appropriate flags, run the stress script, and verify the container gets OOM-killed when the memory limit is exceeded by checking the OOM kill status.
_Note: The container mem_test and image myapp:mem with the stress script are already available.
Example
# Before (no memory limits)
$ docker inspect mem_test --format 'Memory: {{.HostConfig.Memory}}'
Memory: 0
$ docker inspect mem_test --format 'OOMKilled: {{.State.OOMKilled}}'
OOMKilled: false
# After (memory limits applied and stress script triggers OOM)
$ docker inspect mem_test --format 'Memory: {{.HostConfig.Memory}}'
Memory: 104857600
$ docker inspect mem_test --format 'OOMKilled: {{.State.OOMKilled}}'
OOMKilled: true
$ docker inspect mem_test --format 'ExitCode: {{.State.ExitCode}}'
ExitCode: 137
Terminal requires a larger screen
Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.
Linux Terminal Environment
Write and execute your solution in the terminal below.
DeliveryHero
Accenture
Coinbase
Adobe
EPAM
Twitch
Amazon
Kayak
Autodesk
Lyft
Revolut
RedHat
Bloomberg
Datadog
Palantir
TCS
HashiCorp
Google
DeutscheBank
GitHub
Apple
Cloudflare
Stripe
Microsoft
NVIDIA
GoDaddy
X
SAP
Spotify
Airbnb
Meta
Reddit
Yelp
Okta
Dropbox
Slack
ActivisionBlizzard
Zscaler
Uber
IBM
Robinhood
GitLab
Shopify
Samsung
Elastic
Twilio
Netflix
CrowdStrike
Ubisoft
Anthropic
Capital One
Splunk
Intel
AMD
Databricks