Chrome uses /dev/shm for shared memory, which is typically limited to 64MB on CI runners and containers. When Chrome exhausts this, it crashes mid-session with "Event stream closed" errors. Auto-detect CI/container environments and pass --disable-dev-shm-usage to use /tmp instead.