marimo icon indicating copy to clipboard operation
marimo copied to clipboard

Very large console outputs can make Chrome tab unresponsive

Open akshayka opened this issue 1 year ago • 0 comments

Describe the bug

If you create a cell that prints a LOT of console outputs, the frontend becomes unresponsive (hard to scroll, things don't render, buttons don't work) and Chrome prompts you to kill it.

It's never a good idea to print this much stuff, but sometimes it happens accidentally -- in this case better to show the last N lines rather than become unresponsive.

Additionally, this affected the entire Home server and all open notebooks -- all open tabs became unresponsive -- even though only one of the notebooks had the extremely large console output.

Environment

{
  "marimo": "0.5.2",
  "OS": "Linux",
  "OS Version": "6.5.0-27-generic",
  "Processor": "x86_64",
  "Python Version": "3.10.12",
  "Binaries": {
    "Browser": "123.0.6312.122",
    "Node": "v18.13.0"
  },
  "Requirements": {
    "click": "8.1.3",
    "importlib-resources": "6.1.0",
    "jedi": "0.19.0",
    "markdown": "3.4.4",
    "pymdown-extensions": "10.3",
    "pygments": "2.16.1",
    "tomlkit": "0.12.0",
    "uvicorn": "0.24.0.post1",
    "starlette": "0.27.0",
    "websocket": "missing",
    "typing-extensions": "4.8.0",
    "black": "23.3.0"
  }
}

Code to reproduce

for i in range(1000000):
    print(i)

akshayka avatar May 15 '24 19:05 akshayka