Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CRITICAL] Memory leak with geo #3204

Open
VolanDeVovan opened this issue Feb 5, 2025 · 0 comments
Open

[CRITICAL] Memory leak with geo #3204

VolanDeVovan opened this issue Feb 5, 2025 · 0 comments

Comments

@VolanDeVovan
Copy link

Describe the Bug

When I launch Umami, the service consumes all of the RAM on my machine (all 32 GB) and crashes due to insufficient memory. During my investigation, I discovered the cause of the problem.

In the src/lib/detect.ts module, there's code that loads GeoLite2-City.mmdb:

  // Database lookup
  if (!lookup) {
    // eslint-disable-next-line no-console
    console.log('debug: loading GeoLite2-City.mmdb'); // Code added by me
    const dir = path.join(process.cwd(), 'geo');

    lookup = await maxmind.open(path.resolve(dir, 'GeoLite2-City.mmdb'));
  }

This code is executed a very large number of times during startup, which is why the RAM is exhausted.

I tried adding a debug line after the condition, and here's what I got:

Image

I'm running the latest version in Docker: ghcr.io/umami-software/umami:postgresql-v2.15.1

P.S I already tried updating the maxmind library and it didn't solve the problem

Database

PostgreSQL

Relevant log output

Which Umami version are you using? (if relevant)

No response

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant