waha icon indicating copy to clipboard operation
waha copied to clipboard

[GOWS] - Memory leak

Open matteus-siqueira opened this issue 11 months ago • 5 comments

I'm using version 11.4 and it's still having memory leaks. This server had the API running for approximately 24 hours, with only 18 active sessions during that entire period. The server has 6GB of RAM and 2 CPUs.

Note: I'm using S3 and PostgreSQL.

Image

patron:PLUS

matteus-siqueira avatar Dec 06 '25 13:12 matteus-siqueira

I've noticed that behavior, and to me 12.1 has fixed it.

LordMrcS avatar Dec 07 '25 14:12 LordMrcS

I've noticed that behavior, and to me 12.1 has fixed it.

I'll test it and bring updates.

patron:PLUS

matteus-siqueira avatar Dec 07 '25 14:12 matteus-siqueira

The peaks are fine, but the constant growth isn't. 🤔 Let's see if the update helps. @matteus-siqueira, could you attach the htop for this service or your Discord contact? We'll need more information and some diagnostic tools to determine the issue.

patron:PRO

devlikepro avatar Dec 08 '25 04:12 devlikepro

I have the same issue

patron:PLUS

nagi1 avatar Dec 17 '25 12:12 nagi1

Same pattern here, with some numbers in case they help.

Setup: WAHA CORE 2026.9.2, GOWS, one session, local storage, Docker with a 1 GB limit. After a restart the container sits around 400 MB, then crosses 80% of 1 GB within 4-20 hours on busy days. Our watchdog has been restarting it about once a day since July.

I took two heap snapshots (WAHA_DEBUG_MODE + /api/server/debug/heapsnapshot) on the same day, at 05:35 and 16:00, with the limit raised to 2 GB for the test:

  • JS heap: 176 MB -> 174 MB. No object type grew.
  • Container peaked at 1.5 GB during the day.
  • At 16:00 the Node process (MainThread) had ~834 MB RSS against ~174 MB of JS heap. gows was ~95 MB.
  • cgroup memory was mostly anon, not file cache.
  • Media downloads run at roughly 40/hour (including Status posts).

So the growth looks like native/off-heap memory in the Node process, not JS objects and not gows. Media handling (download buffers, the Lottie -> WebP path through @napi-rs/canvas + sharp) would be my first guess, but I haven't confirmed it. I'm trying MALLOC_ARENA_MAX=2 now and will report back. Happy to collect other diagnostics if you tell me what's useful.

Seithx avatar Nov 24 '26 17:11 Seithx