Sometimes, a plug-in consumes more memory than what has been allocated to it by the plug-in author or Che defaults. An example of such a case is the use of a language server with a project that has many source files (&8gt; 10 000). RAM consumption in such circumstances needs to be tuned, otherwise the machine that runs the Che workspaces kills the process with an out-of-memory error (OOM) error.
Users can override the RAM limit and request for a particular plug-in in their workspace configuration.
-
Set the
memoryLimitand/ormemoryRequestfor devfile component to1000Mor10Gi, or any other value formatted as a number and a unit (b, k, ki, m, mi, g, gi). When no unit is specified, the number is in bytes.
Using this notation, units that contain the character i, denote a number that is of the power 2, such as 1024 (as opposed to numbers that use a power of 10, such as 1000).
|
Example of an attribute that sets the RAM limit for the YAML language server plug-in to 768 mebibytes (1073741824 bytes) and RAM request to 500 megabytes:
components:
- id: redhat/vscode-yaml/0.3.0
type: chePlugin
memoryLimit: 768mi
memoryRequest: 500M
Example of an attribute that sets the CPU limit for the YAML language server plug-in to 1.5 cores and CPU request to 500 millicores:
components:
- id: redhat/vscode-yaml/0.3.0
type: chePlugin
cpuLimit: 1.5
cpuRequest: 500m