How to limit memory usage

I'm using a change node to "set flow.chart" to the value "msg.payload" to save my chart data, how do I limit how much it stores? I only want 7 days worth of data at most, and not just keep adding forever.

If you are talking about dashboard chart, then you can set it to display 7 days and it will only output 7 days of data. Otherwise you would need to slice the output array and keep the last x elements (total elements for 7 days of data).

yes dashboard chart. Doesn't it store the data long term? It is persistent so it stays after a power cycle, and I load the data on power up

Chart node stores and outputs only the data set in the x-axis last or points, set in the chart config

But I'm taking the output of the chart to store the data, and I believe it appends the stored data so that it can be loaded on power up and then the chart only displays the last 7 days of data. But I think there is more data stored and the chart only loads what it needs to meet the set period of days? Unless I'm wrong on this?

I refer you to my previous answer. The chart node only outputs what is shown, and that is set by the x-axis inputs in the chart config. Unless you are appending it to other stored data, but you have not shown any info for us to know that.

So how much data is in your flow.chart variable?

I don't think you have shown us anything to justify your concern that the data keeps on growing.

The node only stores what you see on the display.

[
    {
        "id": "739201a44f8b4af3",
        "type": "inject",
        "z": "f672d0ac69fd5b97",
        "name": "load2",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "0.5",
        "topic": "",
        "payload": "chart2",
        "payloadType": "flow",
        "x": 870,
        "y": 720,
        "wires": [
            [
                "36cdb53617faf1c5"
            ]
        ]
    },
    {
        "id": "36cdb53617faf1c5",
        "type": "ui_chart",
        "z": "f672d0ac69fd5b97",
        "name": "",
        "group": "8ee0bb75fa4e2113",
        "order": 23,
        "width": 6,
        "height": 5,
        "label": "Solar Charging",
        "chartType": "line",
        "legend": "true",
        "xformat": "auto",
        "interpolate": "linear",
        "nodata": "Solar Amps",
        "dot": false,
        "ymin": "0",
        "ymax": "100",
        "removeOlder": "3",
        "removeOlderPoints": "",
        "removeOlderUnit": "86400",
        "cutout": 0,
        "useOneColor": false,
        "useUTC": false,
        "colors": [
            "#0f80d2",
            "#e70d2e",
            "#f57a0f",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "outputs": 1,
        "useDifferentColor": false,
        "className": "",
        "x": 1040,
        "y": 740,
        "wires": [
            [
                "f42e8a37025b02ad"
            ]
        ]
    },
    {
        "id": "f42e8a37025b02ad",
        "type": "change",
        "z": "f672d0ac69fd5b97",
        "name": "save2",
        "rules": [
            {
                "t": "set",
                "p": "chart3",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1190,
        "y": 760,
        "wires": [
            [
                "138a814a6320d30d"
            ]
        ]
    },
    {
        "id": "8ee0bb75fa4e2113",
        "type": "ui_group",
        "name": "Main",
        "tab": "9d03c9290d696c27",
        "order": 1,
        "disp": false,
        "width": 12,
        "collapse": false,
        "className": ""
    },
    {
        "id": "9d03c9290d696c27",
        "type": "ui_tab",
        "name": "Solar Power Stats",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

How do you add new data to the chart?

[
    {
        "id": "ae0553679c5b2543",
        "type": "link in",
        "z": "f672d0ac69fd5b97",
        "name": "link in 2",
        "links": [
            "438617e01b830bc8"
        ],
        "x": 165,
        "y": 660,
        "wires": [
            [
                "0ac13c022bbdfb4a",
                "9513c969a881eb86"
            ]
        ]
    },
    {
        "id": "0ac13c022bbdfb4a",
        "type": "function",
        "z": "f672d0ac69fd5b97",
        "name": "Charge Conv",
        "func": "msg.payload = (((msg.payload) * .0818 )+.0818); .081\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 310,
        "y": 660,
        "wires": [
            [
                "71c5b793186fdcc8"
            ]
        ]
    },
    {
        "id": "71c5b793186fdcc8",
        "type": "smooth",
        "z": "f672d0ac69fd5b97",
        "name": "",
        "property": "payload",
        "action": "mean",
        "count": "5",
        "round": "",
        "mult": "single",
        "reduce": false,
        "x": 480,
        "y": 660,
        "wires": [
            [
                "90404ad4f7da1e1c",
                "61f2cf5e9c4d772d"
            ]
        ]
    },
    {
        "id": "61f2cf5e9c4d772d",
        "type": "switch",
        "z": "f672d0ac69fd5b97",
        "name": "zero",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "gte",
                "v": "0",
                "vt": "num"
            },
            {
                "t": "lt",
                "v": "0",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 310,
        "y": 820,
        "wires": [
            [
                "7f4787605eed55ed",
                "781ab50bf2f08b19",
                "ba42fb48b881e044"
            ],
            [
                "e453d16b5dce47ea"
            ]
        ]
    },
    {
        "id": "7f4787605eed55ed",
        "type": "change",
        "z": "f672d0ac69fd5b97",
        "name": "solar 2",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "solar2",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 490,
        "y": 820,
        "wires": [
            [
                "e213b42ead503fb3",
                "1a9c070f341a26ba"
            ]
        ]
    },
    {
        "id": "1a9c070f341a26ba",
        "type": "delay",
        "z": "f672d0ac69fd5b97",
        "name": "",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "minute",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "allowrate": false,
        "outputs": 1,
        "x": 870,
        "y": 760,
        "wires": [
            [
                "36cdb53617faf1c5"
            ]
        ]
    },
    {
        "id": "739201a44f8b4af3",
        "type": "inject",
        "z": "f672d0ac69fd5b97",
        "name": "load2",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "0.5",
        "topic": "",
        "payload": "chart2",
        "payloadType": "flow",
        "x": 870,
        "y": 720,
        "wires": [
            [
                "36cdb53617faf1c5"
            ]
        ]
    },
    {
        "id": "36cdb53617faf1c5",
        "type": "ui_chart",
        "z": "f672d0ac69fd5b97",
        "name": "",
        "group": "8ee0bb75fa4e2113",
        "order": 23,
        "width": 6,
        "height": 5,
        "label": "Solar Charging",
        "chartType": "line",
        "legend": "true",
        "xformat": "auto",
        "interpolate": "linear",
        "nodata": "Solar Amps",
        "dot": false,
        "ymin": "0",
        "ymax": "100",
        "removeOlder": "3",
        "removeOlderPoints": "",
        "removeOlderUnit": "86400",
        "cutout": 0,
        "useOneColor": false,
        "useUTC": false,
        "colors": [
            "#0f80d2",
            "#e70d2e",
            "#f57a0f",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "outputs": 1,
        "useDifferentColor": false,
        "className": "",
        "x": 1040,
        "y": 740,
        "wires": [
            [
                "f42e8a37025b02ad"
            ]
        ]
    },
    {
        "id": "f42e8a37025b02ad",
        "type": "change",
        "z": "f672d0ac69fd5b97",
        "name": "save2",
        "rules": [
            {
                "t": "set",
                "p": "chart3",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1190,
        "y": 760,
        "wires": [
            [
                "138a814a6320d30d"
            ]
        ]
    },
    {
        "id": "8ee0bb75fa4e2113",
        "type": "ui_group",
        "name": "Main",
        "tab": "9d03c9290d696c27",
        "order": 1,
        "disp": false,
        "width": 12,
        "collapse": false,
        "className": ""
    },
    {
        "id": "9d03c9290d696c27",
        "type": "ui_tab",
        "name": "Solar Power Stats",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

A description would have been sufficient.
You appear to be adding a point every minute, with a chart span of 3 days, so there should never be more than 4320 points in the saved array.

If you want to reduce the array size you can change the number of days to display or set the rate limit to a greater value, or move the smooth node to after the rate limit. Experiment, it really helps you learn.