'containerized node app wont run on server, but will run in wsl
i have two identical folders that hold a nextjs app.
one sits in wsl, the other sits on a server.
when i run the following to have the app in a container:
podman run \
-v /home/mee/dev/abd/:/usr/src/app -w /usr/src/app \
-p 3000:3000 \
--name next.dev node:latest \
npm run dev
it works in wsl:
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Loaded env from /usr/src/app/.env.local
event - compiled client and server successfully in 905 ms (190 modules)
does not work on the server:
> [email protected] dev
> next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Loaded env from /usr/src/app/.env.local
warn - As of Tailwind CSS v2.2, `lightBlue` has been renamed to `sky`.
warn - Please update your color palette to eliminate this warning.
<--- Last few GCs --->
[14:0x5667d50] 89995 ms: Mark-sweep 483.6 (499.7) -> 479.9 (500.0) MB, 1420.0 / 2.0 ms (average mu = 0.207, current mu = 0.042) allocation failure scavenge might not succeed
[14:0x5667d50] 92296 ms: Mark-sweep 484.1 (500.2) -> 480.3 (500.5) MB, 2156.7 / 0.0 ms (average mu = 0.129, current mu = 0.063) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0xb2e180 node::Abort() [node]
2: 0xa4019e node::FatalError(char const*, char const*) [node]
3: 0xd1fc3e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xd1ffb7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xed93e5 [node]
6: 0xeea82d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
7: 0xeed55e v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
8: 0xeaef7a v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
9: 0x122f3d8 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
10: 0x1632879 [node]
Aborted
now my question is, is it because my webserver isn't hooked up yet - or is this an issue with the app - maybe something that's forgive on wsl but not in the server ( some sort of memory leak )? if so, is there a way for me to diagnose the issue?
thanks!
edit: in wsl these are the container stats:
ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS
b6821569de9f next.dev -- 493.2MB / 3.135GB 15.73% 4.21kB / 8.393kB -- / -- 23
on server:
grep MemTotal /proc/meminfo
MemTotal: 999808 kB
total used free shared buff/cache available
Mem: 976 342 412 3 221 479
Swap: 511 389 122
i will try to upgrade the size
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
