openclaw - 💡(How to fix) Fix [Bug]: The tasks in ./openclaw/jobs.json cause the WebUI to crash. [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#48948Fetched 2026-04-08 00:50:38
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Participants
Timeline (top)
commented ×2labeled ×2mentioned ×1subscribed ×1

If the jobs.json configuration is not empty, the gateway process will run wildly, with memory usage reaching 2.4GB. It will only resume after jobs.json is cleared out.

Error Message

1.When configuring a scheduled task, an error is reported immediately.

Root Cause

If the jobs.json configuration is not empty, the gateway process will run wildly, with memory usage reaching 2.4GB. It will only resume after jobs.json is cleared out.

RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Summary

If the jobs.json configuration is not empty, the gateway process will run wildly, with memory usage reaching 2.4GB. It will only resume after jobs.json is cleared out.

Steps to reproduce

1.When configuring a scheduled task, an error is reported immediately. 2.The command openclaw gateway restartcannot restore it; 3.The command openclaw doctor --fixcannot restore it; 4.Restarting the server still cannot restore it.

Expected behavior

normal

Actual behavior

webui crash

OpenClaw version

2026.3.13

Operating system

macOS 13.7.8

Install method

npm

Model

minimax 2.5

Provider / routing chain

openclaw->minimax.io

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To resolve the issue, we need to optimize the memory usage of the gateway process when handling the jobs.json configuration.

  • Step 1: Optimize Configuration Loading
    • Modify the configuration loading mechanism to load jobs.json in chunks or lazily, rather than loading the entire file into memory at once.
    • Example (in JavaScript):

const fs = require('fs'); const readline = require('readline');

// Load jobs.json in chunks const fileStream = fs.createReadStream('jobs.json'); const rl = readline.createInterface({ input: fileStream, crlfDelay: Infinity });

let chunk = ''; rl.on('line', (line) => { chunk += line; // Process the chunk console.log(chunk); chunk = ''; });

*   **Step 2: Implement Memory Monitoring**
    *   Monitor the memory usage of the gateway process and restart it when memory usage exceeds a certain threshold.
    *   Example (in JavaScript using `node-os-utils`):
        ```javascript
const osUtils = require('node-os-utils');

// Monitor memory usage
osUtils.memInfo().then((info) => {
  if (info.usedMemPercent > 80) {
    // Restart the process
    console.log('Memory usage exceeded threshold. Restarting...');
    process.exit(1);
  }
});
  • Step 3: Clear jobs.json on Restart
    • Clear the jobs.json file when the gateway process restarts to prevent memory issues.
    • Example (in JavaScript using fs):

const fs = require('fs');

// Clear jobs.json on restart fs.writeFile('jobs.json', '', (err) => { if (err) { console.error('Error clearing jobs.json:', err); } else { console.log('jobs.json cleared.'); } });


### Verification
To verify that the fix worked, restart the gateway process and monitor its memory usage. The process should no longer consume excessive memory, and the `jobs.json` file should be cleared on restart.

### Extra Tips
*   Regularly clean up the `jobs.json` file to prevent it from growing indefinitely.
*   Consider implementing a more efficient data storage solution, such as a database, to replace the `jobs.json` file.
*   Monitor the gateway process's memory usage and adjust the threshold value as needed to prevent unnecessary restarts.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

normal

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING