Gagal yarn run build (kurang memori) #3

Closed
opened 2025-03-10 17:48:48 +07:00 by mario · 0 comments
Owner

Problem

Terjadi ketika:

  • yarn run build dari /Viewer dan eror ketika 87% Sealing Code
  • yarn run build dari /Viewer/platform/app dan muncul error:
37% building 1/2 entries 15385/15400 dependencies 2488/5178 modulesKilled
error Command failed with exit code 137.

Penjelasan

Eror tersebut disebabkan kurangnya memori sistem (4 GB) yang dibutuhkan untuk build webpack (karena memory intensive). Minimal RAM adalah 8 GB

Solusi

Membuat tambahan swap memori 8 GB

  1. Create a swap file:
    sudo fallocate -l 8G /swapfile
    
  2. Set permissions:
    sudo chmod 600 /swapfile
    
  3. Format the file as swap:
    sudo mkswap /swapfile
    
  4. Enable the swap file:
    sudo swapon /swapfile
    
  5. Verify the swap space:
    free -h
    

To make the swap file persistent across reboots, add it to /etc/fstab:

echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
## Problem Terjadi ketika: - `yarn run build` dari /Viewer dan eror ketika 87% Sealing Code - `yarn run build` dari /Viewer/platform/app dan muncul error: ```sh 37% building 1/2 entries 15385/15400 dependencies 2488/5178 modulesKilled error Command failed with exit code 137. ``` ## Penjelasan Eror tersebut disebabkan kurangnya memori sistem (4 GB) yang dibutuhkan untuk build webpack (karena memory intensive). Minimal RAM adalah 8 GB ## Solusi Membuat tambahan swap memori 8 GB 1. Create a swap file: ```bash sudo fallocate -l 8G /swapfile ``` 2. Set permissions: ```bash sudo chmod 600 /swapfile ``` 3. Format the file as swap: ```bash sudo mkswap /swapfile ``` 4. Enable the swap file: ```bash sudo swapon /swapfile ``` 5. Verify the swap space: ```bash free -h ``` To make the swap file persistent across reboots, add it to `/etc/fstab`: ```bash echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mario/ohif-viewer#3