Updated on 2026-08-10 GMT+08:00

Insufficient Memory

Symptom

Error code CC.00040010.400 is displayed.

The log contains "Channel "unknown": channel is already closed".

Cause Analysis

The code volume is too large, and the executor memory is insufficient during engine check.

Solution

If the JavaScript, TypeScript, or CSS language is checked and the log contains "ERROR The analysis will stop due to the Node.js process running out of memory (heap size limit xxxx MB)", perform the following operations:

  • xxxx indicates the default heap memory limit. In this case, you can add a file named sonar-project.properties to the root directory of the code repository and write sonar.javascript.node.maxspace=8192 to the file. This indicates that the default heap memory limit is 8 GB. (The value must be greater than xxxx in the error description, not necessarily 8 GB.)

Use any of the following methods to reduce the code in a task:

  • Split the task into multiple tasks and set rule sets in different languages for them. For details about how to set a rule set, see Configuring a Rule Set.

    For example, to check code in multiple languages, such as Java, C, and C#, within task A, split the task into tasks A1, A2, and A3, and set the Java, C, and C# rule sets, respectively.

  • Split the task into multiple tasks, exclude some files from the split tasks, and then check the code. For details about how to exclude files, see Configuring Check Scope.

    For example, split task A into tasks A1, A2, and A3, and set them to check only file 1, file 2, and file 3, respectively.

  • Split the code repository used by the task into multiple sub-repositories, create tasks respectively, and check the code.