unclecode / unclecode/crawl4ai
[Bug]: Memory Leak on Repeated /md Requests via Docker (MacOS) — Container Crashes Randomly Over Time
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 83.9k
- Forks
- 8.7k
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 11
Description
crawl4ai version
0.6.0-r2 or Latest docker image
Expected Behavior
When sending repeated POST requests to /md every 10 seconds with dynamic URLs, the Docker container should handle each request efficiently without memory leaks or crashes, maintaining stable memory usage over time.
Current Behavior
Initially, everything works fine. However, after some time (randomly, depending on duration and frequency), memory usage starts increasing significantly until the container crashes. This suggests a possible memory leak or improper cleanup of resources on repeated executions.
Attached below is a screenshot showing the memory spike before the crash.
Is this reproducible?
Yes
Inputs Causing the Bug
Example request payload sent via Postman every 10 seconds:
{
"url": "http://www.example.com",
"f": "fit",
"q": null,
"c": "0"
}
Steps to Reproduce
1. Run the crawl4ai app using the Docker setup.
2. Use a tool (like Postman or a script) to send POST requests to http://localhost/md every 10 seconds.
3. Use a changing URL in the request payload for each call.
4. Monitor Docker memory usage over time.
5. Observe the steady increase in memory and eventual container crash.
Code snippets
OS
macOS Sequoia Version 15.5
Python version
3.12
Browser
No response
Browser version
No response
Error logs & Screenshots (if applicable)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Docker setup and reproduce the issue by sending changing-URL POST requests to /md every 10 seconds while monitoring container memory. Profile the repeated requests to identify what is not being cleaned up; done means memory remains stable and the container no longer crashes over sustained requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, macos, python
- Domain
- api, backend, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100