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

Memory leak during configuration update #756

Open
flymedllva opened this issue Apr 25, 2024 · 5 comments
Open

Memory leak during configuration update #756

flymedllva opened this issue Apr 25, 2024 · 5 comments
Labels
bug Something isn't working internally-reviewed The issue has been reviewed internally.

Comments

@flymedllva
Copy link

flymedllva commented Apr 25, 2024

Component(s)

router

Component version

wgc version

controlplane version

router version

v0.82.1

What happened?

Description

When updating the router configuration using r.updateServerAndStart, memory consumption increases.

Enough N times, make the schema puller download and apply a new schema, each time a new schema is applied (they must be different) the memory consumption of the application increases.

This is especially noticeable on large schematics larger than 20 mb.

Steps to Reproduce

I made an example frequently updating the schema, after a few minutes of router operation the memory consumption increases even on a small schema

In order to reproduce, clone the repository and start the router

https://github.com/flymedllva/cosmo-memory-leak-during-configuration-update

cd router && make dev

Commit necessary to reproduce the problem: flymedllva@880955e

Environment information

OS: 14.4 (23E214)
Package Manager: npm
Compiler(if manually compiled): go version go1.22.1 darwin/arm64

Router configuration

version: "1"

# General router options
graph:
  name: "production"
  token: ""

log_level: "info"
listen_addr: "localhost:3002"
playground_enabled: true
introspection_enabled: true
json_log: true
shutdown_delay: 15s
grace_period: 20s
poll_interval: 10s
health_check_path: "/health"
readiness_check_path: "/health/ready"
liveness_check_path: "/health/live"
router_config_path: "config.json"

cors:
  allow_origins: ["*"]
  allow_methods:
    - HEAD
    - GET
    - POST
  allow_headers:
    - Origin
    - Content-Length
    - Content-Type
  allow_credentials: true
  max_age_minutes: 5m

# Config for custom modules   
# See "https://cosmo-docs.wundergraph.com/router/custom-modules" for more information   
modules:
  myModule:
    # Arbitrary values, unmarshalled by the module
    value: 1

Router execution config

No response

Log output

No response

Additional context

Screenshot 2024-04-26 at 00 53 45
@flymedllva flymedllva added the bug Something isn't working label Apr 25, 2024
Copy link

WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible.
The roadmap is driven by our customers and we have to prioritize issues that are important to them.
You can influence the priority by becoming a customer. Please contact us here.

@StarpTech
Copy link
Contributor

Hi @flymedllva please provide a reproducible example. We can't investigate with this little information. Waiting for your feedback!

@StarpTech StarpTech added question Further information is requested internally-reviewed The issue has been reviewed internally. and removed question Further information is requested labels Apr 30, 2024
@flymedllva
Copy link
Author

@StarpTech Enough N times, make the schema puller download and apply a new schema, each time a new schema is applied (they must be different) the memory consumption of the application increases.

@flymedllva
Copy link
Author

@StarpTech hi, I've updated the issue description with a handy example to reproduce the issue, have a look again

Thanks

@StarpTech
Copy link
Contributor

@flymedllva thank you. We'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internally-reviewed The issue has been reviewed internally.
Projects
None yet
Development

No branches or pull requests

2 participants