When a VPS prints only Killed while running npm install, npm run build or a similar command, the usual cause is an operating-system or cgroup memory kill. The shell is reporting that the process received SIGKILL; npm did not generate a normal JavaScript error. On Linux, the out-of-memory (OOM) killer terminates a process when the available memory in the host or its control group is exhausted.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
Do not start by adding a random Node flag. First confirm the mechanism in kernel and service logs, check whether the VPS has usable swap or a provider-imposed memory ceiling, and observe the command’s peak usage. Then apply the least disruptive remedy: free concurrent memory, add swap where permitted, set a carefully chosen V8 heap limit, move the build elsewhere, or resize the instance when the workload’s real peak exceeds the server.
As an Amazon Associate I earn from qualifying purchases.
Recommended Free Tools
What a bare Killed line means
A normal V8 heap failure is normally explicit, with text such as FATAL ERROR: ... JavaScript heap out of memory. A line containing only Killed means the shell saw the process disappear after a forceful signal. On Linux, the most common explanation during an npm install or build is memory exhaustion.
The kernel’s OOM killer chooses a process to terminate when memory cannot be satisfied. Its selection is influenced by values such as oom_score and oom_score_adj; the process that dies is not necessarily the one that allocated the last byte. If the command runs inside a cgroup, cgroup v2 can enforce a limit below the host’s physical RAM. An OOM inside that cgroup is contained there, so the host may still show free memory while the service or shell running Node is killed.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
That distinction explains many apparently contradictory reports: a 2 GB VPS can kill a build even when a quick glance at total host memory looks acceptable, because a provider, container, systemd unit or hosting panel has assigned the process a smaller limit.
Confirm the cause before changing settings
Use this sequence immediately after reproducing the failure. Record the evidence before rebooting or clearing logs.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Record the environment. Save the output of
node -vandnpm -v. Note the Linux distribution, the VPS’s advertised RAM, whether swap is exposed, and whether the provider documents a memory limit. npm’s installation guidance treats supported Node and npm versions and a supported installation method as the starting checks. - Check available headroom. Run
free -handswapon --show. During the failing command, watchtoporhtoprather than relying on a before-and-after snapshot. A brief spike can be enough to trigger a kill. - Inspect kernel records. Run
dmesg -T | grep -i -E 'out of memory|killed process|oom'. Also inspect the current boot’s kernel journal withjournalctl -k -b. Look for a record namingnode,npmor the service that launched it. - Inspect the service journal when applicable. If a system service performs the install or build, run
journalctl -u <unit>and correlate its timestamp with the kernel entry. A service can be killed by its own cgroup even when an interactive shell would have a different limit. - Check cgroup counters. For the cgroup containing the process, read its
memory.eventsfile. An increase inoomoroom_killis strong evidence that the cgroup, rather than npm’s error handling, ended the process. The relevant cgroup path depends on how the VPS and service manager are configured. - Measure from Node when you need more detail. A small diagnostic script can print
process.memoryUsage(), which reports RSS and other memory fields.process.constrainedMemory()reports a memory limit when one is imposed. Compare those observations with the host and cgroup records instead of treating the V8 heap as the complete process footprint.
A kernel OOM record naming the process, or a rising cgroup oom_kill counter, confirms an OS-level kill. If those records are absent, investigate other causes such as an external supervisor, a manual kill -9, a job timeout or a wrapper script that terminates the command.
Separate V8 heap exhaustion from an OS or cgroup kill
Node’s --max-old-space-size=SIZE option controls the V8 old-generation heap. It does not cap every byte used by the process. Native modules, buffers, worker threads, npm itself, the package manager’s file operations and the operating system all need memory outside that heap.
| Observed symptom | What to verify | Likely action |
|---|---|---|
FATAL ERROR: ... JavaScript heap out of memory |
Node reached its V8 old-generation limit | Profile the workload and adjust --max-old-space-size only if the machine has enough total headroom |
Plain Killed plus an OOM or killed process kernel entry |
The host’s OOM killer terminated the process | Reduce concurrent memory use, add permitted swap, or provide more RAM |
Plain Killed plus a rising cgroup oom_kill counter |
A cgroup limit was reached | Raise or remove the limit, move the job to a larger environment, or reduce its peak below that ceiling |
| The command vanishes without OOM evidence | Supervisor logs, shell history and job-timeout settings | Find the external signal or timeout before changing Node memory settings |
Raising the V8 heap cannot repair a hard cgroup ceiling. It can make an OS kill more likely if it allows Node to consume memory that the kernel needed for the rest of the system. Conversely, setting the heap too low can produce a V8 error even when RAM is available.
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
Fixes, in the order that usually makes sense
1. Free memory and remove simultaneous peaks
Before changing the application, stop services that are not needed for the operation and avoid running a database, compiler and npm build at the same time. A small server can have enough average memory but fail when several ordinary processes peak together.
Run the install or build in a quiet maintenance window. Close shells that launch duplicate watchers, stop unused application workers, and check top or htop for other large processes. npm performs practical concurrency internally, and npm’s troubleshooting guidance notes that resource-related races and errors can occur. Updating to a current stable Node and npm release is a supported first check, particularly when an old toolchain is handling dependencies inefficiently.
2. Add swap when the VPS actually permits it
Swap can absorb a short-lived allocation spike and prevent an immediate kill when physical RAM is temporarily exhausted. Verify whether it is active with swapon --show, then confirm after configuration that the kernel sees the swap space. A swap-backed build will usually be slower than one staying in RAM, especially when it begins paging heavily.
Swap is not an escape from a provider-enforced cgroup limit. If the cgroup’s allowed memory includes a strict ceiling or the provider disallows swap accounting, adding a local swap file may not change the result. Treat swap as shock absorption, not as a replacement for capacity. Linux’s vm.swappiness setting affects how readily pages are moved, but changing it does not create additional memory or remove an OOM condition.
3. Set a conservative Node heap limit only after measuring
On a very small host, you can set a limit for the command with:
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
export NODE_OPTIONS=--max-old-space-size=512
Choose the value from observed peak usage and leave room for the kernel, npm, native allocations and every other service. The number is workload-specific: a 512 MB old-generation limit may let a modest build coexist with a web service, but it can make a larger dependency graph fail with a V8 error.
Node’s command-line documentation gives a useful illustration: on a machine with 2 GiB of memory, it suggests considering 1536 (1.5 GiB) so memory remains for other uses and swapping is avoided. That is an example, not a universal setting. A 2 GB VPS running a database and web server may need a much smaller Node limit, while an isolated build machine may tolerate more. Re-run the measurement after each change and keep the setting with the workload, rather than applying it globally to unrelated Node services.
4. Reduce dependency and build pressure
Use a committed lockfile and npm ci for reproducible installation. It avoids resolving a different dependency tree on every deployment and is generally preferable for automated builds. For a production runtime, omit development dependencies when the application permits; they can be needed during compilation but not at runtime.
These steps reduce work and variability, but they do not defeat a hard memory cap. A lockfile can still describe a graph whose peak extraction, native compilation or bundling demand exceeds the VPS. If the build repeatedly reaches the same ceiling, move the build rather than endlessly tuning flags.
5. Build elsewhere or resize the instance
When logs show that the workload’s genuine peak is above the VPS limit, the durable choices are a larger instance or a separate temporary builder. Build in continuous integration or on a temporary machine with more memory, then deploy the resulting artifact to the small production VPS. This keeps the runtime host inexpensive while giving dependency installation and bundling the resources they need.
Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
Resizing the VPS is simpler when builds, database migrations and runtime traffic must share one machine. A larger instance also reduces the risk that a production request competes with a deployment spike. If the provider’s limit is cgroup-specific, moving to a plan with more host RAM will help only when the new plan also raises the process’s effective limit; confirm that detail with the provider.
Choosing among the remedies
| Remedy | Effect on peak memory | Trade-off | Best fit |
|---|---|---|---|
| Stop unused services and serialize jobs | Removes competing peaks immediately | Less concurrency during maintenance | A host where other processes are consuming headroom |
| Swap | Absorbs short spikes beyond physical RAM | Slower when pages are read from or written to disk; ineffective against a provider ceiling | Occasional bursts on a VPS that permits swap |
| V8 heap cap | Restricts JavaScript old-generation growth | Too low a value causes a V8 heap error; it does not cap native or total process memory | Controlling Node’s share on a shared, measured host |
Lockfile, npm ci and production-only dependencies |
Reduces resolution and dependency work | Does not remove a hard peak requirement | Repeatable deployments and smaller runtime installs |
| Temporary builder or CI | Moves the highest peak off the production VPS | Requires an artifact-and-deploy workflow | Small production hosts with memory-heavy builds |
| Larger VPS | Raises available capacity when the plan’s limit also increases | Higher recurring cost | Builds and runtime services must coexist or fail consistently at the ceiling |
Use six questions to make the choice: how much peak memory can be removed, whether the provider permits swap, how much build speed you can lose to paging, whether reproducible CI artifacts fit the deployment process, what a larger instance costs, and whether the limit is host-wide or specific to the cgroup.
A practical playbook for a 1 GB VPS
A 1 GB machine has little room for a compiler, npm’s filesystem work and a running application at the same time. Start with a maintenance window and collect the logs and memory snapshots described above.
- Stop the application workers and any database or watcher that is not required for the deployment.
- Confirm whether swap exists with
swapon --show. If the provider permits it, add swap according to the provider’s documented procedure and verify it afterward. - Run the install with the lockfile using
npm ci, not an unconstrained dependency update. - If a build is still required on the host, set a measured
NODE_OPTIONS=--max-old-space-size=...value that leaves space for the operating system and npm. Begin conservatively; a value that is too low will identify itself with a V8 heap error. - If kernel or cgroup evidence still records a kill, stop trying larger heap values. Use a temporary builder or move to a plan with a higher effective memory limit.
Do not run the production server and a memory-heavy build concurrently on this class of machine unless monitoring shows a clear margin.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.A practical playbook for a 2 GB VPS
Two gigabytes provides more flexibility but is not a guarantee. Databases, language runtimes, file caches and native compilation can consume the difference.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
- Measure the idle footprint with
free -h, then watch the complete build intoporhtop. - Compare the peak with the Node heap and with the cgroup’s effective limit. Use
process.memoryUsage()andprocess.constrainedMemory()when a Node-level view is needed. - Keep development dependencies and build tooling out of the runtime installation where possible.
- Use a heap limit only when it prevents Node from crowding out other services; Node’s 1,536 MB example for a 2 GiB machine assumes memory must remain for other uses and should not be copied blindly.
- If the peak remains above the available limit, build off-host or resize. More swap may prevent a brief spike but will not make a consistently oversized build reliable.
Common failure modes and what to do next
“There is free RAM, so it cannot be OOM.”
Check the process’s cgroup. A container or service can hit its own limit while the host retains free memory. The cgroup’s memory.events counters and the kernel journal reveal this case.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
“I increased --max-old-space-size and it was killed sooner.”
The larger V8 allowance may have consumed the memory that the kernel and other services needed. Revert to a value based on measured headroom, reduce concurrency, or move the build. A heap setting is not a total-memory budget.
“Adding swap changed nothing.”
Confirm that swapon --show lists active swap and determine whether the provider’s cgroup limit includes or forbids it. If oom_kill rises inside the cgroup, swap cannot override that ceiling. Also consider that a build can be consistently larger than the combined usable RAM and swap performance envelope.
“The process disappeared but there is no OOM entry.”
Look at journalctl -u <unit>, job-runner logs and shell history for an external signal or timeout. Do not label every bare Killed message an OOM without corroborating evidence.
“The install works interactively but fails during deployment.”
The deployment service may run in a different cgroup, with less memory than your login shell. Compare the service journal, cgroup counters and process.constrainedMemory() in both contexts. Run the same lockfile-based command under the deployment environment before changing the application.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Preventing the next surprise kill
Keep the Node and npm versions, distribution, VPS size and effective memory limit recorded with the deployment configuration. Preserve kernel and service logs long enough to investigate a failed release. During scheduled builds, monitor RSS and the host’s available memory rather than only CPU usage; a CPU-idle process can still be approaching its memory ceiling.
For recurring jobs, capture Node’s process.memoryUsage() fields at meaningful build phases and note whether process.constrainedMemory() reports a limit. Alert on cgroup oom and oom_kill counter changes, and treat a kernel OOM record as a deployment failure requiring capacity review.
Reproducible lockfile installs and off-host builds also make recovery easier: if a release fails, the previous artifact can continue serving while the build runs on a suitable machine. When the measured peak continues to exceed the production host’s effective limit, capacity—not another npm flag—is the problem to solve.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →




