Heap overflow when building grafana frontend from source

i followed the documentation of the developer guideline , and i am building grafana from srouce on the following setup:

OS: Ubuntu 20.04.1 LTS x86_64  
Host: HP Notebook  
Kernel: 5.15.0-122-generic  
Uptime: 7 hours, 41 mins  
CPU: Intel i7-7500U (4) @ 3.500GHz  
GPU: AMD Radeon R7 / Intel HD Graphics 620  
Memory: 1624MiB / 11873MiB

when i ran :

yarn start

I had the following output :

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0xe17ec6 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [webpack]
 2: 0x123b8c0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [webpack]
 3: 0x123bb97 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [webpack]
 4: 0x14696c5  [webpack]
 5: 0x14696f3  [webpack]
 6: 0x14827aa  [webpack]
 7: 0x1485978  [webpack]
 8: 0x1cc0a01  [webpack]
Aborted (core dumped)
Error: Command failed: "webpack" "--config" "scripts/webpack/webpack.dev.js" "--watch"
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at Object.nxExecCommand (/home/wass/grafana/node_modules/nx/src/command-line/exec/exec.js:30:38)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Object.handler (/home/wass/grafana/node_modules/nx/src/command-line/exec/command-object.js:11:13) {
  status: 134,
  signal: null,
  output: [ null, null, null ],
  pid: 21295,
  stdout: null,
  stderr: null
}

I guess you need more memory.

can i only build the backend and modify it ? without the frontend

yes, I don’t see a reason why not. Of course, you must now what you are doing.