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 using custom tariff formula #18072

Closed
1 task done
skrul opened this issue Jan 6, 2025 · 1 comment · Fixed by #18098
Closed
1 task done

Memory leak using custom tariff formula #18072

skrul opened this issue Jan 6, 2025 · 1 comment · Fixed by #18098
Labels
bug Something isn't working

Comments

@skrul
Copy link

skrul commented Jan 6, 2025

Describe the bug

When I use a custom tariff formula, I've noticed that the evcc process' rss memory size continues to grow until the oom killer kicks in. Without custom tariff formula the process' rss is a steady 80MB. This was measured using telegraf and its procstat filter. The flat part of this graph is without any tariff config, and the hockey stick is with the custom tariff formula:

Screenshot 2025-01-05 at 8 15 23 PM

Steps to reproduce

Use the tariffs configuration below.

Configuration details

tariffs:
  currency: USD
  grid:
      type: custom
      price:
        source: const
        value: 0
      formula: |
        0.35;

Log details

Log is below but has nothing interesting:

[main  ] INFO 2025/01/06 05:19:13 evcc 0.132.0 (e4f8d24b)
[main  ] INFO 2025/01/06 05:19:13 using config file: /etc/evcc.yaml
[db    ] INFO 2025/01/06 05:19:13 using sqlite database: /root/.evcc/evcc.db
[mqtt  ] INFO 2025/01/06 05:19:13 connecting evcc-1961274272 at tcp://10.0.0.101:1883
[main  ] INFO 2025/01/06 05:19:13 listening at :7070
[mqtt  ] DEBUG 2025/01/06 05:19:13 tcp://10.0.0.101:1883 connected
[site  ] INFO 2025/01/06 05:19:14 site config:
[site  ] INFO 2025/01/06 05:19:14   meters:      grid ✓ pv ✓ battery ✓
[site  ] INFO 2025/01/06 05:19:14     grid:      power ✓ energy ✓ currents ✗
[site  ] INFO 2025/01/06 05:19:14     pv 1:      power ✓ energy ✓ currents ✗
[site  ] INFO 2025/01/06 05:19:14     battery 1: power ✓ energy ✗ currents ✗ soc ✓ capacity ✗
[site  ] INFO 2025/01/06 05:19:14   vehicles:
[site  ] INFO 2025/01/06 05:19:14     vehicle 1: range ✓ finish ✗ status ✓ climate ✗ wakeup ✓
[lp-1  ] INFO 2025/01/06 05:19:14 loadpoint 1:
[lp-1  ] INFO 2025/01/06 05:19:14   mode:        off
[lp-1  ] INFO 2025/01/06 05:19:14   charger:     power ✗ energy ✗ currents ✗ phases ✗ wakeup ✗
[lp-1  ] INFO 2025/01/06 05:19:14   meters:      charge ✗
[site  ] DEBUG 2025/01/06 05:19:14 set buffer soc: 90
[site  ] DEBUG 2025/01/06 05:19:14 set priority soc: 60
[site  ] DEBUG 2025/01/06 05:19:14 set battery discharge control: true
[lp-1  ] DEBUG 2025/01/06 05:19:14 phase timer inactive
[lp-1  ] DEBUG 2025/01/06 05:19:14 pv timer inactive
[lp-1  ] INFO 2025/01/06 05:19:14 vehicle updated: unknown -> Tesla Model 3
[site  ] DEBUG 2025/01/06 05:19:20 ----
[lp-1  ] DEBUG 2025/01/06 05:19:20 charge power: 0W
[site  ] DEBUG 2025/01/06 05:19:20 grid power: 0W
[site  ] DEBUG 2025/01/06 05:19:20 pv 1 power: 0W
[site  ] DEBUG 2025/01/06 05:19:20 battery 1 power: 452W
[site  ] DEBUG 2025/01/06 05:19:20 battery 1 soc: 84%
[site  ] DEBUG 2025/01/06 05:19:20 site power: 552W
[lp-1  ] DEBUG 2025/01/06 05:19:22 charger status: B
[lp-1  ] INFO 2025/01/06 05:19:22 car connected
[lp-1  ] DEBUG 2025/01/06 05:19:22 pv timer elapse
[lp-1  ] DEBUG 2025/01/06 05:19:22 pv timer inactive
[lp-1  ] DEBUG 2025/01/06 05:19:27 vehicle status: B
[lp-1  ] DEBUG 2025/01/06 05:19:27 vehicle soc: 30%
[lp-1  ] DEBUG 2025/01/06 05:19:28 vehicle soc limit: 64%
[lp-1  ] DEBUG 2025/01/06 05:19:30 vehicle range: 122km
[lp-1  ] DEBUG 2025/01/06 05:19:30 plan: charge 2h15m52s between 2025-01-06 12:44:08 +0100 CET until 2025-01-06 15:00:00 +0100 CET (power: 7360W, avg cost: 0.000)
[lp-1  ] DEBUG 2025/01/06 05:19:30 pv charge current: 0A = 0A + -2.4A (552W @ 1p)
[lp-1  ] DEBUG 2025/01/06 05:19:30 pv enable timer reset
[lp-1  ] DEBUG 2025/01/06 05:19:30 pv timer inactive
[pushover] DEBUG 2025/01/06 05:19:30 sending to ***
...

What type of operating system or environment does evcc run on?

Linux

Nightly build

  • I have verified that the issue is reproducible with the latest nightly build

Version

evcc version 0.132.0 (e4f8d24)

@andig
Copy link
Member

andig commented Jan 6, 2025

This is bad. Depends on traefik/yaegi#1678.

@andig andig added the bug Something isn't working label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants