Htop full of config commands eating much Memory

The longer my Pi runs the more RAM it consumes. I see this command all over the place:
python3 -m homeassistant --config/config

I’m running Home Assistant 2022.3.7 (core) dockerized.

python3 -m homeassistant --config /config is the standard commandline for HA. It is not configuring anything, it is simply pointing to the configuration directory.

Quite why you have so many apparently running I am not sure. Does htop have a line for each thread? Do you have more than one instance of the container running?

I am running one container only.

I have this too - I created a sensor and an automation to kill off the “rogue” ones. Do you want me share that with you?

Obviously it’s just a plaster until someone manages to pinpoint why it happens.

Here is the sensor that holds the count for the automation :

  - platform: command_line
    name: ha_instances
    command: pgrep -f 'python3 -m homeassistant --config /config' | wc -l
    scan_interval: 60

Here is the command line to kill them off :

shell_command:
  kill_rogue_ha: pgrep -f 'python3 -m homeassistant --config /config' |awk 'NR >= 2' | xargs -n1 kill -9

Here is the automation YAML :

- id: '1655301326453'
  alias: Kill rogue HA Instances
  description: ''
  trigger:
  - platform: template
    value_template: '{{ states(''sensor.ha_instances'')| int -1 > 1}} '
  condition: []
  action:
  - service: shell_command.kill_rogue_ha
    data: {}

I hope this helps you.

Great thank you. I’ll try it out. Can you explain what’s happening there? Is this a bug or a feature? :slight_smile:

A bug as far as I can work out - not everyone has the situation. I’m running HAOS on an RPI4 so nothing special. I have raised an issue on Github here :

Maybe you can add your experience as well so it doesn’t look like it’s just me!

I’m not that much of a Linux expert but I am wondering, why do I see these processes on the host? I’m running home assistant in a container of docker.

I’ve recently started experiencing this issue… Did anyone find out what was causing it?