cosmo
cosmo copied to clipboard
Memory leak during configuration update
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: https://github.com/flymedllva/cosmo-memory-leak-during-configuration-update/commit/880955ebc9e0435e3d9c2dfed7faa3dfb57f56c9
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
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.
Hi @flymedllva please provide a reproducible example. We can't investigate with this little information. Waiting for your feedback!
@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.
@StarpTech hi, I've updated the issue description with a handy example to reproduce the issue, have a look again
Thanks
@flymedllva thank you. We'll take a look.
Have you looked at this problem? Any news?
Hi @flymedllva, it is on our list, but it is not our highest priority. Please consider https://github.com/wundergraph/cosmo/issues/756#issuecomment-2078248440. If this issue prevents you from making progress with WunderGraph, please consider becoming a customer. This allows us to put the necessary resources on this.
Hi @flymedllva
Has this improved with the latest version?
Thanks