Error while bench update on production

Building frappe assets…

<— Last few GCs —>

[27772:0x25576f0] 10824 ms: Scavenge 184.0 (208.7) -> 177.5 (214.2) MB, 145.4 / 8.5 ms allocation failure
[27772:0x25576f0] 24305 ms: Scavenge 190.4 (214.2) -> 183.6 (219.2) MB, 87.6 / 7.2 ms allocation failure
[27772:0x25576f0] 25894 ms: Scavenge 194.7 (219.2) -> 187.9 (224.7) MB, 87.6 / 11.6 ms allocation failure
[27772:0x25576f0] 38445 ms: Scavenge 200.8 (224.7) -> 194.3 (227.2) MB, 208.8 / 8.7 ms allocation failure

<— JS stacktrace —>
Cannot get stack trace in GC.
FATAL ERROR: NewSpace::Rebalance Allocation failed - process out of memory
1: node::Abort() [/usr/bin/node]
2: 0x8cd14c [/usr/bin/node]
3: v8::Utils::ReportOOMFailure(char const*, bool) [/usr/bin/node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/bin/node]
5: 0xa6717b [/usr/bin/node]
6: v8::internal::MarkCompactCollector::Evacuate() [/usr/bin/node]
7: v8::internal::MarkCompactCollector::CollectGarbage() [/usr/bin/node]
8: v8::internal::Heap::MarkCompact() [/usr/bin/node]
9: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/bin/node]
10: v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node]
11: v8::internal::factory::NewStruct(v8::internal::InstanceType) [/usr/bin/node]
12: v8::internal::factory::NewTuple3(v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object) [/usr/bin/node]
13: v8::internal::LoadIC::LoadFullChain(v8::internal::Handlev8::internal::Map, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Name, v8::internal::Handlev8::internal::Smi) [/usr/bin/node]
14: v8::internal::LoadIC::UpdateCaches(v8::internal::LookupIterator*) [/usr/bin/node]
15: v8::internal::LoadIC::Load(v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Name) [/usr/bin/node]
16: v8::internal::Runtime_LoadIC_Miss(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/bin/node]
17: 0x35df22f842fd
Killed

error Command failed with exit code 137.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
bench@double-rhinos-cement-server:~/frappe-bench$

Thank You

@trentmu is right

You want to increase your server memory. Try increasing swap to 2 or 4GB